It seems that the long "code" at the end is the same type of code when I copy the UUID of a KM macro. Using AppleScript, I can run a KM macro by using this:
tell application "Keyboard Maestro Engine"
do script "C0A02743-D829-4D2A-83CC-5C0547FBD665"
end tell
I tried the same with CCC, but no luck:
tell application "Carbon Copy Cloner"
do script "0C70107A-09CF-43A7-9775-5E269C9E24D1"
end tell
Maybe there's a similar "Engine" for the CCC, but I can't seem to find it.
Anyone familiar with CCC that can help me with this?
The “code” is a UUID - a universally unique identifier and in the case of CCC it just uniquely identifies a particular CCC task.
So the link you’ve copied is actually an x-callback URL and you use it like you would an ordinary url but it doesn’t point to a web address in this case but a CCC task.
Since I’m not at my Mac I can’t create an example for you to use but instead look at this discussion to see an example of how to use it:
There may be other examples in the forum - just search for callback.
Thanks for sharing that thread. Unfortunately, I can't really understand what you guys are discussing there, as my knowledge is not at that level yet...
My question is: if that x-callback url contains a UUID as well (or so it seems), can't I use it (just the UUID portion, of course) the same way as I use the UUID to trigger a KM macro using AppleScript?
Sorry I can’t spoon feed you a solution since I’m not at my Mac so try this.
Create a macro with an Open URL action in it - a bit like this one:
Now paste the link you got from CCC into the Open URL field in the action and then change the with drop-down to Carbon Copy Cloner or CCC (whichever shows in the drop-down list).
Now run the macro and it should run the CCC task whose link you copied originally.
The issue with this, is that the link doesn't actually run the task, it just opens CCC and selects the task. After that I still need to go to "Run Now". That's why I was asking if I was able to run the task via AppleScript the same way I can do it with KM and the UUID of a macro.
I can still create a macro with those steps, but if I was able to start it without CCC being activated first, and just run the macro in the background, even better.
It would appear that if you put this line in an Execute Shell Script action:
ccc -s"Task Name"
It would start the task called "Task Name". You'll notice that it needs the name of the task rather than its UUID, so this might be easier for you to use.
I was looking at the link you shared and it seems that there's really no option to use the UUID, right? I'm asking, because if by any chance I need to rename the task, then using the UUID would still make the task run.
If not, no worries. This works as expected. Really appreciate it
I couldn’t find any documentation on the Bombich site about using the x-callback url so for the time being you’ll have to rely on using the ccc utility. But at least you’ve got a way forward!
It looks from the man page that you can print a list of task names and UUIDs with ccc -u.
That suggests that, if you know the UUID, you could search the output of ccc -u and extract the corresponding task name, then use that task name in the command to start/stop tasks.
I don't have CCC so can't test anything, but if you post the (suitably redacted) output from running ccc -u in Terminal someone should be able to suggest something.
But probably the best answer is -- don't rename your tasks!