It is usually much shorter, more elegant script, much faster to run, and user can't break it during execution. Keystroke return - close the save as dialogĢ) the method using Applescript instructions. Keystroke return - close the go to dialog Keystroke "Desktop/Sample" - path from Documents folder to Sample folder on Desktop Keystroke "v" using command down - paste the title from clipboard Keystroke "s" using command down - open save dialogĭelay 0.5 - to let save as dialog time to open Keystroke "c" using command down - command C (copy) Key code 125 using shift down - shift down (select 1st line) Key code 126 using command down - command up (cursor at start) Up to you to use them or not: tell application "TextEdit" I added some extra options to select the path to save (go home folder, enter special path.). I recommend that you add comments as I did (how to remember that key code 8 is 'c' !). And finally, you're hardly dependent of user interface of the application: if the editor (here Apple with TextEdit) changes something, like a short cut key, your script will no longer work.ĭespite that, if you still want to use that way, here is the script that does it for you. During the script, if user hits key/mouse by mistake, your script will fail. It is not recommended for mainly 3 reasons: It is usually slow (you need to add delays to leave time for system open window, close them.). You simulate keyboard events like a user. 1) the method using GUI scripting: this is what you've started to do.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |