Shirt Pocket Discussions  
    Home netTunes launchTunes SuperDuper! Buy Now Support Discussions About Shirt Pocket    

Go Back   Shirt Pocket Discussions > SuperDuper! > General
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #17  
Old 08-13-2006, 01:48 PM
john love john love is offline
Registered User
 
Join Date: Apr 2004
Posts: 22
Pass the srcDisk and destDisk parms from SuperDuper's shell script to AppleScript

What I was trying to do initially was access within the shell script a specific handler in the AppleScript and that did not work for me.

Then I simply accessed the whole AppleScript from the shell script and within the AppleScript's on run handler accessed the specific handler ... and this worked.

After burrowing around Apple's AppleScript Bulleting Board , I found out how to pass parameters from within a shell script to an external AppleScript script ...

1) my shell script = "set_icon_shell_script.txt":

#!/bin/sh
echo "Restoring icon ..."

osascript ~/Library/Application\ Support/SuperDuper\!/Saved\ Settings/set_icon_applescript_from_shell.scpt "iMac Internal HD" "iMac_Internal_DU"

2) duped it (so I can retain the original .txt)
3) chmod +x on the copy within Terminal
4) changed the copy's suffix to .command as in "set_icon_shell_script.command"

Then I double-clicked the ".command" file, Terminal started up and it worked, as described below.

Next, is the AppleScript code:

on run parms
set theSrcDisk to item 1 of parms
set theDestDisk to item 2 of parms

copyAllFiles(theSrcDisk, theDestDisk)
end run

on copyAllFiles(srcDisk, destDisk)

-- code

end copyAllFiles

Anyway, it worked.

Just one thing is lacking ... above I have what I call the long-way-around path for the AppleScript file within my osascript call ...

This AppleScript file is in the same Folder as my shell script, yet just using:

osascript set_icon_applescript_from_shell.scpt parm1 parm2

generates "no such file" in the Terminal. ?????

Cheers!

John Love
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot find target volume Timmy General 6 03-13-2006 01:06 PM
maintaining target volume icon yoxi General 43 12-16-2005 09:41 AM
SD sannot find target Volume problem braeside General 7 09-02-2005 03:59 PM
Error while trying to enable permissions on target volume Hoosier_1701 General 11 07-16-2005 11:50 AM
Cannot find target volume -- Even with volume mounted! cmod General 3 06-03-2005 09:21 AM


All times are GMT -4. The time now is 02:35 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.