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

Go Back   Shirt Pocket Discussions > SuperDuper! > General

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-25-2007, 01:48 PM
minckster minckster is offline
Registered User
 
Join Date: Apr 2006
Posts: 18
Pause/Restart VisualHub & Transmission for SD! backup

I'd like to see if anyone has any comments or suggestions for the way that I went about pausing and restarting VisualHub and Transmission during SuperDuper's backups. It works, but seems a bit messy and convoluted. (If left running, VisualHub and Transmission muck up SD's backups because they create large files and run for a long time.)

The general idea is that I created an AppleScript using Script Editor to pause the two apps and another to restart them. Since SuperDuper! won't let me run an AppleScript before and after backups (and since I couldn't figure out how to translate them into shell scripts ), I saved the AppleScripts as applications (File -> Save As -> application from dropdown menu). Lo and behold! SD would let me run my newly created applications as scripts before and after my backup.

The AppleScripts follow. The shortcuts to pause the apps are cmd-. for ViusualHub and opt-cmd-. for Transmission.
Code:
-- Pause VisualHub or Transmission, if running 
tell application "System Events"
	if ((count (every process whose name is "VisualHub")) > 0) then
		tell application "VisualHub" to activate
		tell application "System Events"
			tell process "Visualhub"
				-- Pause Conversion in VisualHub
				keystroke "." using {command down}
			end tell
		end tell
	end if
	
	if ((count (every process whose name is "Transmission")) > 0) then
		tell application "Transmission" to activate
		tell application "System Events"
			tell process "Transmission"
				-- Pause all downloads in Transmission
				keystroke "." using {option down, command down}
			end tell
		end tell
	end if
end tell
Code:
-- Resume VisualHub or Transmission, if running 
tell application "System Events"
	if ((count (every process whose name is "VisualHub")) > 0) then
		tell application "VisualHub" to activate
		tell application "System Events"
			tell process "Visualhub"
				-- Resume Conversion in VisualHub
				keystroke "/" using {command down}
			end tell
		end tell
	end if
	
	if ((count (every process whose name is "Transmission")) > 0) then
		tell application "Transmission" to activate
		tell application "System Events"
			tell process "Transmission"
				-- Resume all downloads in Transmission
				keystroke "/" using {option down, command down}
			end tell
		end tell
	end if
end tell
I should mention that I tried
Code:
#!/bin/sh
exec osascript <<END
. . . (insert AppleScript here) 
END
but that caused the VirtualHub and Transmission to open before the script evaluated "count (every process ...", so the if-clause was always true.

Please be gentle! They're only my second and third AppleScripts, and are the result of much Googling, copying, pasting, trial and error.
Reply With Quote
 


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
SuperDuper Failing on Backup - I/O Errors Stephen Kuhn General 1 08-13-2006 04:03 PM
Source HD won't boot after canceled Backup enderws General 3 03-04-2006 04:02 PM
How to verify a Scheduled Backup? tuqqer General 3 12-06-2005 06:50 PM
(Zero-length) File caused SuperDuper to abort backup alancfrancis General 7 08-31-2005 10:42 AM
Smart Backup Error bill s General 20 02-04-2005 09:46 AM


All times are GMT -4. The time now is 04:12 AM.


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