Welcome Guest

Pages: 1
Can't seem to get the run AppleScript action to work?
zeltakPostApril 6, 2022, 01:48
Newbie
Posts: 23
Registered:
February 20, 2021, 12:14
Normal topicCan't seem to get the run AppleScript action to work?

Hi!

I have a super simple AppleScript:

do shell script "'/Applications/Carbon Copy Cloner.app/Contents/MacOS/ccc' -s 'Music::Qnap::daily'"

I saved it as a file here:

/Users/zeltak/bin/Music-Qnap-Daily.scpt

now when I add this as an action I always get an error (see screenshot)

the command runs well from both the CLI and from other gui apps (like Keyboard Maestro)

any clue what im doing wrong here?

best

Z
Image

2MR2PostApril 6, 2022, 06:43
Avatar photo
Administrator
Posts: 2079
Registered:
August 23, 2012, 19:27
Normal topicCan

There's either too much, or not enough going on here 🙂

There's Yate calling out to the shell and there's AppleScript which is more than likely unnecessary.

First off, the error message is 99% caused by the script file not being executable. If you end the script file with a .yatesh filename extension, Yate will adjust the privilege of the file automatically. Also you're attempting to execute the do shell script AppleScript command directly in the shells script and Yate is invoking a system shell.

If you're calling the command line of CCC you don't need any AppleScript. Put something like the following in the file.:

#!/bin/sh
/Applications/Carbon Copy Cloner.app/Contents/MacOS/ccc' -s 'Music::Qnap::daily'"

I've just copied the content from your post. I'm not sure as to what CCC's command line format is.

If you really want to call AppleScript, use the Call AppleScript Function statement which bypasses shells entirely.

zeltakPostApril 6, 2022, 13:21
Newbie
Posts: 23
Registered:
February 20, 2021, 12:14
Normal topicCan

thx so much!!

works with a bash script!

thx again

Z

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.034 seconds.