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

Go Back   Shirt Pocket Discussions > SuperDuper! > General

Reply
 
Thread Tools Rate Thread Display Modes
  #16  
Old 12-10-2006, 06:23 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Teamwork!
__________________
--Dave Nanian
Reply With Quote
  #17  
Old 12-11-2006, 09:08 PM
eriolarda eriolarda is offline
Registered User
 
Join Date: Dec 2006
Posts: 2
Here's how I got it to work. The idle handler in the AppleScript checks whether SuperDuper is running; if so, it comes back after 2 secs to check again. When SD is gone, that must mean the share isn't being used any more. So then it ejects, then quits itself. (Replace "YourShare" with the name of your share.)

The Applescript needs to be saved as App, with "stay open" option active.


Code:
global BackupInProgress, BackupPartPresent

on goodbye()
	quit
end goodbye

on idle
	if BackupInProgress is false then
		
		tell application "Finder"
			if (exists the disk "YourShare") then
				eject "YourShare"
				set BackupPartPresent to false
				
			end if
			if (exists the disk "YourShare") then
				
			end if
		end tell
		goodbye()
	else
		tell application "System Events" to (creator type of processes) contains "SdPr"
		
		set BackupInProgress to the result
		-- beep 1
		--return 2
		
	end if
	return 2
	
end idle
on run
	set BackupPartPresent to true
	
	tell application "System Events" to (creator type of processes) contains "SdPr"
	
	set BackupInProgress to the result
	
	idle
end run
Since SD can't seem to call scripts that stay open, I have this snippet called from SD (replace "/path/to/TheAppleScript.app" with path to where your Applescript resides)

Code:
open ~/path/to/TheAppleScript.app
exit
For some reason, I couldn't get it to work with the "osascript" command.

Actually this feature should really be built in!
Reply With Quote
  #18  
Old 01-02-2007, 11:25 AM
xtian666 xtian666 is offline
Registered User
 
Join Date: Jan 2007
Posts: 2
Quote:
Originally Posted by dnanian View Post
I think you'll now be able to do this with a single line, since the mini-script worked, the tricky thing being escaping things properly, and I couldn't figure it out. So put the eject in a little saved script:

Code:
tell application "Finder" to eject "mjg"
save as text or a compiled script, and do:

Code:
#!/bin/sh
nohup /bin/bash -c "sleep 20; osascript path/to/the/script/file" &
The applescript works great, but how do I impliment the shell command into SuperDuper?
Reply With Quote
  #19  
Old 01-02-2007, 11:26 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Set it as the "after copy" shell script in the Advanced tab of Options.
__________________
--Dave Nanian
Reply With Quote
  #20  
Old 01-02-2007, 11:36 AM
xtian666 xtian666 is offline
Registered User
 
Join Date: Jan 2007
Posts: 2
Quote:
Originally Posted by dnanian View Post
Set it as the "after copy" shell script in the Advanced tab of Options.
Obscenely fast response - you guys rock :-)

But a dense reply... I have the applscript saved and it works fine when I manually launch it. The shell command I assumed would be copied and pasted into the "after copy" section under the Advanced tab. However, this brings up an open dialog box so do I just save the shell command as a text file and then point the "after copy" to that file?
Reply With Quote
  #21  
Old 01-02-2007, 11:39 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Yes. You save it as a text file, mark it as executable (chmod +x the-file), and point to that.
__________________
--Dave Nanian
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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
Booting from backup guruuno General 27 10-16-2009 11:53 PM
SD! & HDD copy speed fun DaleMeyn General 3 03-20-2006 04:24 PM
Copy error and crash offdahook84 General 3 10-01-2005 10:10 PM
BackUp hangs at 3% JimK General 10 09-27-2005 09:48 AM
Error: No space left on device tradervic General 11 06-29-2005 04:50 PM


All times are GMT -4. The time now is 10:31 PM.


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