View Single Post
  #13  
Old 12-10-2006, 02:12 PM
michael.green michael.green is offline
Registered User
 
Join Date: Nov 2006
Posts: 14
And away the share goes! That did the trick. Yay!

Let me see if I understand (a) what happened and (b) what has to be done next.

(a) What happened?
(i) osascript = we're sending something to a program other than the shell. Applescript and the Finder, I think.
(ii) <<77 = we're starting here, 77 is a delimiter
(iii) tell the Finder to eject the volume -- that's what we want the other programs to do.
(iv) 77 = the other delimiter; that's the end of what we're sending to the other program.

(b) Now what comes next? We need to:
(i) wait for 20 seconds or so
(ii) run in the background.
So ...

Code:
#!/bin/sh
sleep 20
osascript <<77
tell application "Finder" to eject "mjg"
77
The second line waits for 20 seconds; that works in my testing. Task (b)(i) done.

But (b)(ii) is stumping me. Putting & or bg in various parts of this script produces errors. If I had to guess (and I do), it's that there should be something between the 77s that accomplishes this. But neither my books nor the internet is helping much.
Reply With Quote