So, my script may help.
I made a change because I forgot to give a special treatment for empty cells.
--{code}
--[SCRIPT columns_backwards]
(*
Enregistrer le script en tant que Script : columns_backwards.scpt
déplacer le fichier ainsi créé dans le dossier
<VolumeDeDĂ©marrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-ĂȘtre crĂ©er le dossier Numbers et peut-ĂȘtre mĂȘme le dossier Applications.
SĂ©lectionner le groupe de cellules Ă traiter
Aller au menu Scripts , choisir Numbers puis choisir âcolumns_backwardsâ
Dans chaque ligne de la sélection, le groupe de cellules sélectionné sera recopié en ordre inversé.
--=====
Lâaide du Finder explique:
LâUtilitaire AppleScript permet dâactiver le Menu des scripts :
Ouvrez lâUtilitaire AppleScript situĂ© dans le dossier Applications/AppleScript.
Cochez la case âAfficher le menu des scripts dans la barre de menusâ.
Sous 10.6.x,
aller dans le panneau âGĂ©nĂ©ralâ du dialogue PrĂ©fĂ©rences de lâĂditeur Applescript
puis cocher la case âAfficher le menu des scripts dans la barre des menusâ.
--=====
Save the script as a Script: columns_backwards.scpt
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
Select the range of cell to treat.
Go to the Scripts Menu, choose Numbers, then choose âcolumns_backwardsâ
In each row of the selection, the selected cells will be copied backwards.
--=====
The Finderâs Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the âShow Script Menu in menu barâ checkbox.
Under 10.6.x,
go to the General panel of AppleScript Editorâs Preferences dialog box
and check the âShow Script menu in menu barâ option.
--=====
Yvan KOENIG (VALLAURIS, France)
2011/05/27
2011/05/27 -- added special treatment for blank cells
*)
--=====
on run
local dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2, nbColumns, r, i
set {dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
set nbColumns to colNum2 + 1 - colNum1
repeat with r from rowNum1 to rowNum2
tell row r
set les_valeurs to value of cellscolNum1 thru colNum2
repeat with i from 1 to nbColumns
set theVal to item (nbColumns + 1 - i) of les_valeurs
if theVal is 0.0 then
clear cell (colNum1 - 1 + i)
else
set value of cell (colNum1 - 1 + i) to theVal as text
end if
end repeat
end tell
end repeat
end tell
end run
--=====
(*
set { dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
*)
on get_SelParams()
local d_name, s_name, t_name, row_num1, col_num1, row_num2, col_num2
tell application "Numbers" to tell document 1
set d_name to its name
set s_name to ""
repeat with i from 1 to the count of sheets
tell sheet i to set maybe to the count of (tables whose selection range is not missing value)
if maybe is not 0 then
set s_name to name of sheet i
exit repeat
end if -- maybe is not 0
end repeat
if s_name is "" then
if my parleAnglais() then
error "No sheet has a selected table embedding at least one selected cell !"
else
error "Aucune feuille ne contient une table ayant au moins une cellule sélectionnée !"
end if
end if
tell sheet s_name to tell (first table where selection range is not missing value)
tell selection range
set {top_left, bottom_right} to {name of first cell, name of last cell}
end tell
set t_name to its name
tell cell top_left to set {row_num1, col_num1} to {address of its row, address of its column}
if top_left is bottom_right then
set {row_num2, col_num2} to {row_num1, col_num1}
else
tell cell bottom_right to set {row_num2, col_num2} to {address of its row, address of its column}
end if
end tell -- sheetâŠ
return {d_name, s_name, t_name, row_num1, col_num1, row_num2, col_num2}
end tell -- Numbers
end get_SelParams
--=====
on parleAnglais()
local z
try
tell application "Numbers" to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z is not "Annuler")
end parleAnglais
--=====
--[/SCRIPT]
--{code}
Yvan KOENIG (VALLAURIS, France) vendredi 27 mai 2011 21:48:40
iMac 21â5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.7
Please : Search for questions similar to your own before submitting them to the community
To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !