I need to launch two terminal commands thru applescript/automator with delay between them.

Absolutely don't know how to do it thru applescript, so I tried to do it thru automator and here what it says when i try to launch PRLCTL command: ***'sh: prlctl: command not found'.


open -a Parallels\ Desktop

prlctl start "Windows 10"

Launching them directly thru terminal is working. Can somebody help me with figuring out how can I save it in one file and launch these two comand with it.

  • Why do you need to first open Parallels Desktop to use its prlctl command line utility. I would think that shouldn't be necessary, as it not for the vmrun command line utility in VMware Fusion. Sep 19 at 21:23
  • Thanks for ans answer below, realy, the main question is how to run prlctl utility with help of applescript or automator. I'm absolute lamer in applescript. Can I ask your help with this task? I realy need this command to work thru applescript or autoamtor but dunno how to do this.
    – Andrew
    Sep 19 at 22:42
  • Andrew, I've updated the answer. Sep 19 at 22:55

The PATH passed to a do shell script command in AppleScript, or a do shell script command in a Run AppleScript action in an Automator workflow, or a Run Shell Script action in an Automator workflow is /usr/bin:/bin:/usr/sbin:/sbin, and any executable called that is not within that PATH, then the fully qualified pathname needs to be used.

In AppleScript use the do shell script command, e.g.,:

do shell script "open -a 'Parallels Desktop'; /path/to/prlctl start 'Windows 10'"

In Automator you can use a Run AppleScript action with the same do shell script command as above.

Or use a Run Shell Script action with, e.g.,:

open -a 'Parallels Desktop'
/path/to/prlctl start 'Windows 10'

If you need a delay between the commands add, e.g., sleep n when n is the number of seconds to delay, e.g.,:

In the do shell script command, e.g.,:

do shell script "open -a 'Parallels Desktop'; sleep n; /path/to/prlctl start 'Windows 10'"

Or in the Run Shell Script action, e.g.,:

open -a 'Parallels Desktop'
sleep n
/path/to/prlctl start 'Windows 10'
  • Thanks a lot. Man you are my savior:)
    – Andrew
    Sep 20 at 2:49
  • Veryfied your answer as right one, but I cannot vote for it, dont have enough reputation. Thank you one more time!
    – Andrew
    Sep 20 at 5:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .