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
Mac OS X Hints
http://hints.macworld.com/article.php?story=20060418121101354