Created
September 15, 2010 02:16
-
-
Save vanmik/580136 to your computer and use it in GitHub Desktop.
applescript allows to insert custom text in any os x app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 'selection' work in Pages.app only | |
tell application "Pages" | |
set selText to selection | |
end tell | |
tell me | |
activate | |
display dialog "Type a tag" default answer "" | |
set the_text to the text returned of result | |
end tell | |
set the clipboard to "<" & the_text & ">" & selText & "</" & the_text & ">" | |
tell application "System Events" | |
tell application "Pages" to activate | |
tell process "Pages" to key code 9 using command down | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment