Preface: I am a newbie and have only written a few scripts from scratch. I usually “borrow” a script and build off of it. This is a problem with a newly written script.
I keep a personal journal and am using Evernote. I follow the exact same steps every morning to start a dew day so I thought this is perfect place for an appleScript. Basically, the script should jump to the top of the page, enter the current date in boldface then start a bulleted list. Essentially, I am executing all the key presses I use to do manually.
When I run it, it pauses while trying to clear the old list line and won’t restart until I move the mouse. That’s the only action I found to get it going again. Anyone have a solution or a reason why the pause happens? I am using a 2013 iMac as fast as they come with Yosemite and the current version of Evernote. Thanks.
tell application "System Events"
-- clear current bulleted list line which ends the previous days list
key code 123 using {command down, shift down} -- select to beginning of line
key code 51 -- DEL
key code 51 -- DEL
-- jump to the top of the page and make some blank lines
key code 126 using {command down} -- jump to top of page
key code 36 -- Return
key code 36 -- Return
key code 126 using {command down} -- jump to top of page again
-- enter the boldface date
key code 2 using {command down, shift down} -- insert full date
key code 123 using {command down} -- jump to beginning of line
key code 124 using {command down, shift down} -- select to end of line
key code 11 using {command down} -- apply bold
key code 124 using {command down} -- jump to end of line
key code 11 using {command down} -- remove bold
-- jump down a line and start a bulleted list
key code 36 -- Return
key code 36 -- Return
keystroke "U" using {command down, shift down} -- Start a bulleted list
end tell