PDA

View Full Version : SuperDuper and Shell Scripting


Beej
05-06-2009, 09:06 PM
Is there a command I can put in a shell script that will tell SuperDuper to 'run now'?

Reason: I'm trying to script some maintenance that will run SuperDuper, restart off the SuperDuper drive, check that everything is OK and restart off the original drive. I would like to do this because part of my normal procedure is to check that the SuperDuper drive is actually bootable and will load to the Desktop.

dnanian
05-06-2009, 09:16 PM
You can use the general techniques we use in the scripting driver to run it with an AppleScript (and osascript will run from a shell script).

Beej
05-07-2009, 09:37 PM
How would I go about learning more about the general techniques you use in the scripting driver?

dnanian
05-07-2009, 09:38 PM
Well, you can extract the applescript from our application bundle (or see the FAQ for a much earlier script). It's reasonably well documented.

rlesperance
05-17-2009, 02:50 AM
Hi dnanian,

Can you be more precise on where (link please) I can have more information on AppleScripting SuperDuper ?


Thanks in advance.


Robert Lespérance ;)

dnanian
05-17-2009, 07:33 AM
You can examine the scripting dictionary, of course, and you can access our script driver in the application bundle. It's called "Copy Job Applescript.template".

rlesperance
05-17-2009, 10:18 AM
Hi,

I have a demo version 2.5 of SD and checked aompletely the SD package. I found only «Copy Job Script.template». There is no AppleScript. If you have the exact path of the folder/files, maybe I missed something.

Also, I cannot open the AppleScript dictionary from the Script Editor.

Do I understand that SD has an AppleScript Dictionnary ? Is this only available in the registered version ? I searched SD's discussions and found no FAQ on the AppleScript subject.

Thanks in advance.



Robert Lespérance

dnanian
05-17-2009, 11:03 AM
That file is AppleScript. Open it with Script Editor.

SD! certainly has a script dictionary and it opens just fine for me!

rlesperance
05-17-2009, 01:23 PM
Hi dnanian,

I am unable to open the «Copy Job Script.template» file from within the Apple Script Editor (v 2.1.1 on Tiger 10.4.11). When forcing to open it with the ASE from within the contextual menu, I get 2 error messages (see picture).

What's wrong ? :o:o:o



Robert Lespérance

dnanian
05-17-2009, 01:33 PM
Perhaps you have to rebuild your Launch Services database, Robert. The dictionary is definitely part of the application bundle.

chris_johnsen
05-17-2009, 04:19 PM
When I drag the file to Script Editor (10.4.11 here), I get (what I assume) are the same error messages (but in English).

But copying the file and giving it the extension ".applescript" allowed Script Edtior to open it.
E.g.: cd /Applications/SuperDuper\!.app/Contents/Resources
cp 'Copy Job Script.template' /tmp/'Copy Job Script.template'.applescript
open /tmp/'Copy Job Script.template'.applescript

rlesperance
05-17-2009, 04:44 PM
Hi Chris,

Should of thought of it ... So simple. Your the genious ! Thank you. Now I need to find the access to the dictionary.

Being able to script SD is superduper !

Thank you again.



Robert

rlesperance
05-18-2009, 10:31 PM
Hi Dnanian,

I am still unable to have access to SD's scripting dictionary. I looked in a few script, but didn't find really what I am looking for.

Is it possible to have access to that dictionary on the web ? Or maybe for you it is a simple script. If the name of my scheduled script is "Smart Update iMac G5 from Macintosh HD" what is the script to tell SD to execute that script now ?

Thanks in advance.



Robert Lespérance

dnanian
05-19-2009, 07:54 AM
If you can't access our scripting dictionary, scripting won't be terribly useful because it wouldn't be able to be compiled, Robert.

rlesperance
05-19-2009, 08:39 AM
Hi dnanian,

The funny thing is that I can script SD. I created a script that monitors the «status» of SD: running, idle or done, and it works.

On the other hand, SD does not reply to a «quit application» command in the script. I don't know what is the problem.

I will post the dictionary problem in the MacScripter discussion.

Regards.


Robert

dnanian
05-19-2009, 08:45 AM
Quit sends a "pending quit" command. It will not quit until all scripts have stopped accessing it, and it won't quit if it wasn't launched by the script.

rlesperance
05-19-2009, 09:34 AM
While I will troubleshoot my dictionary problem, could you tell me how to script this:

If the name of my scheduled script is "Smart Update iMac G5 from Macintosh HD" what is the script to tell SD to execute that script now ?

Thanks in advance.


Robert

dnanian
05-19-2009, 10:01 AM
Basically, you'll load the settings saved with a source/destination drive, script, etc and then run it. The scheduler driver I pointed you to earlier shows you exactly how to do it.

rlesperance
05-19-2009, 10:23 AM
Dnanian,

Excuse me to insist ...

I understand that you want me to work it out by my self, but I tried that way. The scripts are way to complicated for me to understand now without any dictionary. I am not an expert of AppleScript, and I invest alot of time understanding and experiencing. If I need all the content of the «SDCopy Job» script to simply run a single planned script then I understand.

If you can give the 2 lines required for running a planned script immediately, I would appreciate your help for now.

Regards.



Robert

dnanian
05-19-2009, 10:33 AM
You can't do it properly in two lines, Robert. You should basically be doing exactly what the "on run" method does in Copy Job, but with a hardwired settings file.