Typing Text Backwards
Any suggestions? Thanks!!
macbook, Mac OS X (10.5.7)
macbook, Mac OS X (10.5.7)
jor17 wrote:
thanks. how did you copy it into the email? when i try to paste in another document it just posts normal. Thanks!!
on run
my activateGUIscripting()
tell application "Pages" to tell document 1
my shortcut("Pages", "ac", "c")
set the clipboard to (reverse of (characters of (the clipboard as text)) as text)
my shortcut("Pages", "v", "c")
end tell -- Pages
end run
--=====
on activateGUIscripting()
tell application "System Events"
if not (UI elements enabled) then set (UI elements enabled) to true (* to be sure than GUI scripting will be active *)
end tell
end activateGUIscripting
--=====
(*
==== Uses GUIscripting ====
*)
on shortcut(a, t, d)
local k
tell application a to activate
tell application "System Events" to tell application process a
repeat with k in t
if d = "c" then
keystroke (k as text) using {command down}
else if d contains "c" then
if d contains "s" then
if d contains "k" then
keystroke (k as text) using {command down, shift down, control down}
else
keystroke (k as text) using {command down, shift down}
end if
else if d contains "k" then
keystroke (k as text) using {command down, control down}
end if
end if
end repeat
end tell
end shortcut
--=====
--
on run
tell application "Pages" to tell document 1
set the selection to (reverse of (characters of (get contents of the selection))) as text
end tell
end run
--
on run
tell application "Pages" to tell document 1 to set enTexte to (get contents of the selection)
set enListe to characters of enTexte
set enliste2 to reverse of enListe
set enTexte to enliste2 as text
set the clipboard to enTexte
my shortcut("Pages", "v", "c")
end run
--=====
on activateGUIscripting()
tell application "System Events"
if not (UI elements enabled) then set (UI elements enabled) to true (* to be sure than GUI scripting will be active *)
end tell
end activateGUIscripting
--=====
(*
==== Uses GUIscripting ====
*)
on shortcut(a, t, d)
local k
tell application a to activate
tell application "System Events" to tell application process a
repeat with k in t
if d = "c" then
keystroke (k as text) using {command down}
else if d contains "c" then
if d contains "s" then
if d contains "k" then
keystroke (k as text) using {command down, shift down, control down}
else
keystroke (k as text) using {command down, shift down}
end if
else if d contains "k" then
keystroke (k as text) using {command down, control down}
end if
end if
end repeat
end tell
end shortcut
--=====
--
Typing Text Backwards