Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Add Close All Windows to Transmit Apps
Transmit does not have a Close all Windows command, so I wrote this script so I can use the standard keyboard shortcut (Command-Option-W) and run this function from Butler.

tell application "System Events"
	-- Check if UI elements are enabled:
	if not UI elements enabled then
		tell me to display dialog "This script requires GUI scripting to be enabled. For this, you may need to enter your user password."
		set UI elements enabled to true
		if not UI elements enabled then error number -128
	end if
	
	set front_app to (path to frontmost application as Unicode text)
	set AppName to front_app as string
	
	tell me
		set frontAppName to getAppName(AppName)
		--display dialog AppName
	end tell
	if (frontAppName as string is equal to "Transmit.app") then
		tell application front_app
			activate
			try
				tell application "Transmit"
					activate
					try
						repeat with i in every window
							get properties of item 1 of every window
							set windowID to id of result
							close (window id windowID)
						end repeat
					end try
				end tell
			end try
		end tell
	end if
end tell

on getAppName(AppName)
	set AppleScript's text item delimiters to ":"
	set the item_list to every text item of AppName
	set AppName to item -2 of item_list as string
	set AppleScript's text item delimiters to ""
	return AppName
end getAppName


Open the Configuration area of Butler, and add the script.

In the 'Inspector' area to the right of the Configuration area of Butler, do the following:

Under the Options tab, under the Open with menu, select Execute Applescript, and select the script. (Save the text above in Script Editor.)
Under the Triggers tab, set the Hot Key to Command-Option-W. In the same tab, from the Exceptions valid in menu, select Only.
In the text input box below Exceptions Only valid in..., type Transmit.

Transmit should now close all its windows when you invoke the standard keyboard shortcut, Command-Option-W. This should work with other applications as well.

[kirkmc adds: Well, this is certainly interesting, but given the amount of times I use Transmit, Option-clicking the close box is fine for me. However, the principle may appeal to those using other applications that lack this keyboard shortcut.]
    •    
  • Currently 3.00 / 5
  You rated: 5 / 5 (4 votes cast)
 
[6,597 views]  

Add Close All Windows to Transmit | 2 comments | Create New Account
Click here to return to the 'Add Close All Windows to Transmit' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Add Close All Windows to Transmit
Authored by: robJ on Apr 28, '06 12:30:26PM

This works for me:

tell application "Transmit" to close windows



[ Reply to This | # ]
Add Close All Windows to Transmit
Authored by: innate on Apr 30, '06 08:46:22AM

The Transmit guys would probably add the Close All Windows command if you ask them. They have done it for me (I needed a shortcut for New File).



[ Reply to This | # ]