Automator taking forever to run an action

Joined
May 17, 2016
Messages
1
Reaction score
0
Hi

I've been using Automator for very simple task: copy and url from an Excel file, open on Chrome and save the file. So I created a script which repeats a couple of shortcuts, such as Cmd + V, Cmd + C.

I don't know why, but this runs very well at some moments, but there are moments where it takes many seconds between one action and another, when was supposed to just take 1.

How can I fix it? Do you think that because I'm using "delay" between one action and another it may increasing the time? Os is there something wrong in using "repeat"? Below you can see the initial part of the code:

repeat 10 times

tell application "Microsoft Excel"

activate

delay 1

tell application "System Events" to key code 125

delay 1

tell application "System Events" to keystroke "c" using {command down}

delay 1

end tell


tell application "Google Chrome"

activate

delay 1


tell application "System Events" to keystroke "t" using {command down}

delay 1

tell application "System Events" to keystroke "v" using {command down}

delay 1

tell application "System Events" to keystrokereturn

delay 1

end tell


end repeat


Thank you!
 

Cory Cooper

Moderator
Joined
May 19, 2004
Messages
11,105
Reaction score
497
Hello and welcome.

I am not very experienced in AppleScript or Automator. Maybe the folks over at MacScripter could help you out.

C
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top