Fix the Automator action. The ?in bundle with identifier? parameter doesn't exist on my 10.5.5 machine (for some reason, even though the AppleScript Studio Release Notes claim it has since Tiger), which breaks compilation of the action's main script. We don't call the function that uses that phantom parameter, anyway, so I fixed the problem by simply axing the function.

-- main.applescript
-- GrowlAction

on run {input_items, parameters}
	set the output_items to {}
	set the notification_title to (|notificationTitle| of parameters) as string
	set the notification_description to (|notificationDescription| of parameters) as string
	set the notification_priority to (priority of parameters) as integer
	set the notification_sticky to (sticky of parameters) as boolean
	tell application "GrowlHelperApp"
		register as application "Automator" all notifications {"Automator notification"} default notifications {"Automator notification"}
		notify with name "Automator notification" title notification_title description notification_description application name "Automator" sticky notification_sticky priority notification_priority
	end tell
	return input_items
end run

on localized_string(key_string)
	return localized string key_string in bundle with identifier "com.growl.GrowlAction"
end localized_string


Fix the Automator action. The “in bundle with identifier” parameter doesn't exist on my 10.5.5 machine (for some reason, even though the AppleScript Studio Release Notes claim it has since Tiger), which breaks compilation of the action's main script. We don't call the function that uses that phantom parameter, anyway, so I fixed the problem by simply axing the function.


moveForMon.applescript, from darwin13

moveForMon.applescript, from darwin13

property DEF_ALL : false
property DEF_DEBUG_LEVEL : 1

on moveForMon(pars)

	set {all, debug_level} to {DEF_ALL, DEF_DEBUG_LEVEL}
	try
		set all to all of pars
	end try
	try
		set debug_level to debug_level of pars
	end try

	-- debug mode
	if debug_level > 0 then
		log "debug mode = " & debug_level
		if debug_level > 1 then
			display dialog "debug mode = " & debug_level
		end if
	end if

	-- set monitoring tools' positions
	-- SimpleFloatingClock
	set w_sfcCEST to 1
	set w_sfcJST to 2

	-- XRG
	set w_XRG to 1

	-- set monitoring tool's name
	-- GeekTool
	set s_gtCal to "gcalCal"
	set s_gtGcal to "gcalList"
	set s_gtTask to "gtasklist"
	set s_gtPs to "myps"

	-- x posiiotn for monitoring
	set ledge to -160
	set ledgeSFCoffset to 20

	-- y positions
	set y_sfcCEST to 30
	set y_sfcJST to y_sfcCEST + 100
	set y_gtCal to y_sfcJST + 105
	set y_gtGcal to y_gtCal + 115
	set y_gtTask to y_gtGcal + 175
	set y_gtPs to y_gtTask + 85
	set y_XRG to y_gtPs + 75

	-- app to be excepted
	set expApp to {"XRG"}

	-- app to be half size, in left monitor (0.7 times full)
	set halfSizeApp_L to {}

	-- app to be half size, in right monitor (0.7 times full)
	set halfSizeApp_R to {"AdobeReader"}

	-- app only to be moved, in left monitor
	set noResizeApp_L to {}

	-- app only to be moved, in right monitor
	set noResizeApp_R to {"Finder", "Skype", "Microsoft Word", "Microsoft Excel", "Microsoft PowerPoint"}

	-- app to be moved left
	set app_L to {"firefox", "Evernote", "thunderbird", "thunderbird-bin", "Mail"}

	-- app to be moved right
	set app_R to {"iTerm"}

	-- get screen size
	tell application "Finder"
		set scriptPath to (path to me)'s folder as text
	end tell
	set windowSizeScpt to scriptPath & "windowSize.scpt"
	set windowSize to load script file windowSizeScpt

	-- main screen
	set svs to windowSize's getVisibleFrame(1, 1) --+1 is used to avoid edge, especially needed for y position
	set dPosX to (item 1 of svs) + 1
	set dPosY to (item 2 of svs) + 1
	set dWidth to item 3 of svs
	set dHeight to item 4 of svs

	-- try to get left screen
	set dPosX_L to dPosX + 1
	set dPosY_L to dPosY + 1
	try
		set svsL to windowSize's getVisibleFrame(-1, 1)
		set dPosX_L to (item 1 of svsL) + 1
		set dPosY_L to (item 2 of svsL) + 1
	end try

	-- try to get right screen
	set dPosX_R to dPosX + 1
	set dPosY_R to dPosY + 1
	try
		set svsR to windowSize's getVisibleFrame(dPosX + dWidth + 1, 1)
		set dPosX_R to (item 1 of svsR) + 1
		set dPosY_R to (item 2 of svsR) + 1
	end try

	-- move monitoring tools
	if dPosX_L < 0 then
		if debug_level > 0 then
			log "ledge to ledgeDual"
		end if
	else
		set ledge to dWidth + ledge
		if debug_level > 0 then
			log "ledge to ledgeSingle"
		end if
	end if

	tell application "System Events"
		-- SimpleFloatingClock
		try
			set appName to "SimpleFloatingClock"
			tell process appName
				tell window w_sfcCEST
					set size to {1000, 1000}
					set position to {ledge + ledgeSFCoffset, y_sfcCEST}
				end tell
				tell window w_sfcJST
					set size to {1000, 1000}
					set position to {ledge + ledgeSFCoffset, y_sfcJST}
				end tell
			end tell
		end try

		---- GeekTool
		--try
		--	--set appName to "GeekTool"
		--	set appName to "GeekTool Helper" -- for GeekTool 3
		--
		--	tell process appName
		--		set nW to number of windows
		--		--display dialog appName & " in process, nWindows=" & nW
		--		tell window w_gtCal
		--		end tell
		--		tell window w_gtGcal
		--			-- set size to {1000, 1000}
		--			set position to {ledge, y_gtGcal}
		--		end tell
		--		tell window w_gtTask
		--			-- set size to {1000, 1000}
		--			set position to {ledge, y_gtTask}
		--		end tell
		--		tell window w_gtPs
		--			-- set size to {1000, 1000}
		--			set position to {ledge, y_gtPs}
		--		end tell
		--	end tell
		--	--on error errMsg
		--	--	display dialog "ERROR: " & errMsg
		--end try

		-- XRG
		try
			set appName to "XRG"
			tell process appName
				tell window w_XRG
					set size to {1000, 2000}
					set position to {ledge, y_XRG}
				end tell
			end tell
		end try
	end tell

	-- GeekTool (should be outside of application "System Events", and use application "GeekTool Helper" ?)
	-- can't use position to geeklets
	tell application "GeekTool Helper" -- can not use appName (variable), which shows error at id?
		--geeklets
		repeat with g in geeklets
			tell g
				name
				if name is s_gtCal then
					set x position to ledge
					set y position to y_gtCal
				else if name is s_gtGcal then
					set x position to ledge
					set y position to y_gtGcal
				else if name is s_gtTask then
					set x position to ledge
					set y position to y_gtTask
				else if name is s_gtPs then
					set x position to ledge
					set y position to y_gtPs
				end if
			end tell
		end repeat
	end tell

	-- Move/Resize other windows
	if all then
		-- get application name
		tell application "System Events"
			set appList to (get name of every application process whose visible is true)
		end tell

		-- repeat for all app
		repeat with appName in appList
			if appName is not in expApp then
				tell application "System Events"
					try
						tell process appName
							set nW to number of windows
							repeat with i from 1 to nW
								if debug_level > 0 then
									log appName & " " & i
									if debug_level > 1 then
										display dialog appName & " " & i
									end if
								end if
								if appName is in halfSizeApp_L then
									if debug_level > 0 then
										log "half size left"
										if debug_level > 1 then
											display dialog "half size left"
										end if
									end if
									windowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_L, monPosY:dPosY_L, xsize:0.7, ysize:0.7, moveForMon:false, debug_level:debug_level})
								else if appName is in halfSizeApp_R then
									if debug_level > 0 then
										log "half size right"
										if debug_level > 1 then
											display dialog "half size right"
										end if
									end if
									windowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_R, monPosY:dPosY_R, xsize:0.7, ysize:0.7, moveForMon:false, debug_level:debug_level})
								else if appName is in noResizeApp_L then
									if debug_level > 0 then
										log "half size left"
										if debug_level > 1 then
											display dialog "half size left"
										end if
									end if
									windowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_L, monPosY:dPosY_L, resize:0, moveForMon:false, debug_level:debug_level})
								else if appName is in noResizeApp_R then
									if debug_level > 0 then
										log "move right"
										if debug_level > 1 then
											display dialog "move right"
										end if
									end if
									windowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_R, monPosY:dPosY_R, resize:0, moveForMon:false, debug_level:debug_level})
								else if appName is in app_L then
									if debug_level > 0 then
										log "move left full size"
										if debug_level > 1 then
											display dialog "move left full size"
										end if
									end if
									windowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_L, monPosY:dPosY_L, moveForMon:false, debug_level:debug_level})
								else if appName is in app_R then
									if debug_level > 0 then
										log "move right full size"
										if debug_level > 1 then
											display dialog "move right full size"
										end if
									end if
									windowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_R, monPosY:dPosY_R, moveForMon:false, debug_level:debug_level})
								end if
							end repeat
						end tell
					end try
				end tell
			end if
		end repeat
	end if
end moveForMon

on run
	moveForMon({})
end run

property DEF_ALL : false
property DEF_DEBUG_LEVEL : 1

on moveForMon(pars)

	set {all, debug_level} to {DEF_ALL, DEF_DEBUG_LEVEL}
	try
		set all to all of pars
	end try
	try
		set debug_level to debug_level of pars
	end try

	-- debug mode
	if debug_level > 0 then
		log "debug mode = " & debug_level
		if debug_level > 1 then
			display dialog "debug mode = " & debug_level
		end if
	end if

	-- set monitoring tools' positions
	-- SimpleFloatingClock
	set w_sfcCEST to 1
	set w_sfcJST to 2

	-- XRG
	set w_XRG to 1

	-- set monitoring tool's name
	-- GeekTool
	set s_gtCal to "gcalCal"
	set s_gtGcal to "gcalList"
	set s_gtTask to "gtasklist"
	set s_gtPs to "myps"

	-- x posiiotn for monitoring
	set ledge to -160
	set ledgeSFCoffset to 20

	-- y positions
	set y_sfcCEST to 30
	set y_sfcJST to y_sfcCEST + 100
	set y_gtCal to y_sfcJST + 105
	set y_gtGcal to y_gtCal + 115
	set y_gtTask to y_gtGcal + 175
	set y_gtPs to y_gtTask + 85
	set y_XRG to y_gtPs + 75

	-- app to be excepted
	set expApp to {"XRG"}

	-- app to be half size, in left monitor (0.7 times full)
	set halfSizeApp_L to {}

	-- app to be half size, in right monitor (0.7 times full)
	set halfSizeApp_R to {"AdobeReader"}

	-- app only to be moved, in left monitor
	set noResizeApp_L to {}

	-- app only to be moved, in right monitor
	set noResizeApp_R to {"Finder", "Skype", "Microsoft Word", "Microsoft Excel", "Microsoft PowerPoint"}

	-- app to be moved left
	set app_L to {"firefox", "Evernote", "thunderbird", "thunderbird-bin", "Mail"}

	-- app to be moved right
	set app_R to {"iTerm"}

	-- get screen size
	tell application "Finder"
		set scriptPath to (path to me)'s folder as text
	end tell
	set windowSizeScpt to scriptPath & "windowSize.scpt"
	set windowSize to load script file windowSizeScpt

	-- main screen
	set svs to windowSize's getVisibleFrame(1, 1) --+1 is used to avoid edge, especially needed for y position
	set dPosX to (item 1 of svs) + 1
	set dPosY to (item 2 of svs) + 1
	set dWidth to item 3 of svs
	set dHeight to item 4 of svs

	-- try to get left screen
	set dPosX_L to dPosX + 1
	set dPosY_L to dPosY + 1
	try
		set svsL to windowSize's getVisibleFrame(-1, 1)
		set dPosX_L to (item 1 of svsL) + 1
		set dPosY_L to (item 2 of svsL) + 1
	end try

	-- try to get right screen
	set dPosX_R to dPosX + 1
	set dPosY_R to dPosY + 1
	try
		set svsR to windowSize's getVisibleFrame(dPosX + dWidth + 1, 1)
		set dPosX_R to (item 1 of svsR) + 1
		set dPosY_R to (item 2 of svsR) + 1
	end try

	-- move monitoring tools
	if dPosX_L < 0 then
		if debug_level > 0 then
			log "ledge to ledgeDual"
		end if
	else
		set ledge to dWidth + ledge
		if debug_level > 0 then
			log "ledge to ledgeSingle"
		end if
	end if

	tell application "System Events"
		-- SimpleFloatingClock
		try
			set appName to "SimpleFloatingClock"
			tell process appName
				tell window w_sfcCEST
					set size to {1000, 1000}
					set position to {ledge + ledgeSFCoffset, y_sfcCEST}
				end tell
				tell window w_sfcJST
					set size to {1000, 1000}
					set position to {ledge + ledgeSFCoffset, y_sfcJST}
				end tell
			end tell
		end try

		---- GeekTool
		--try
		--	--set appName to "GeekTool"
		--	set appName to "GeekTool Helper" -- for GeekTool 3
		--
		--	tell process appName
		--		set nW to number of windows
		--		--display dialog appName & " in process, nWindows=" & nW
		--		tell window w_gtCal
		--		end tell
		--		tell window w_gtGcal
		--			-- set size to {1000, 1000}
		--			set position to {ledge, y_gtGcal}
		--		end tell
		--		tell window w_gtTask
		--			-- set size to {1000, 1000}
		--			set position to {ledge, y_gtTask}
		--		end tell
		--		tell window w_gtPs
		--			-- set size to {1000, 1000}
		--			set position to {ledge, y_gtPs}
		--		end tell
		--	end tell
		--	--on error errMsg
		--	--	display dialog "ERROR: " & errMsg
		--end try

		-- XRG
		try
			set appName to "XRG"
			tell process appName
				tell window w_XRG
					set size to {1000, 2000}
					set position to {ledge, y_XRG}
				end tell
			end tell
		end try
	end tell

	-- GeekTool (should be outside of application "System Events", and use application "GeekTool Helper" ?)
	-- can't use position to geeklets
	tell application "GeekTool Helper" -- can not use appName (variable), which shows error at id?
		--geeklets
		repeat with g in every «class gLet»
			tell g
				name
				if name is s_gtCal then
					set «class xpos» to ledge
					set «class ypos» to y_gtCal
				else if name is s_gtGcal then
					set «class xpos» to ledge
					set «class ypos» to y_gtGcal
				else if name is s_gtTask then
					set «class xpos» to ledge
					set «class ypos» to y_gtTask
				else if name is s_gtPs then
					set «class xpos» to ledge
					set «class ypos» to y_gtPs
				end if
			end tell
		end repeat
	end tell

	-- Move/Resize other windows
	if all then
		-- get application name
		tell application "System Events"
			set appList to (get name of every application process whose visible is true)
		end tell

		-- repeat for all app
		repeat with appName in appList
			if appName is not in expApp then
				tell application "System Events"
					try
						tell process appName
							set nW to number of windows
							repeat with i from 1 to nW
								if debug_level > 0 then
									log appName & " " & i
									if debug_level > 1 then
										display dialog appName & " " & i
									end if
								end if
								if appName is in halfSizeApp_L then
									if debug_level > 0 then
										log "half size left"
										if debug_level > 1 then
											display dialog "half size left"
										end if
									end if
									windowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_L, monPosY:dPosY_L, xsize:0.7, ysize:0.7, moveForMon:false, debug_level:debug_level})
								else if appName is in halfSizeApp_R then
									if debug_level > 0 then
										log "half size right"
										if debug_level > 1 then
											display dialog "half size right"
										end if
									end if
									windowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_R, monPosY:dPosY_R, xsize:0.7, ysize:0.7, moveForMon:false, debug_level:debug_level})
								else if appName is in noResizeApp_L then
									if debug_level > 0 then
										log "half size left"
										if debug_level > 1 then
											display dialog "half size left"
										end if
									end if
									windowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_L, monPosY:dPosY_L, resize:0, moveForMon:false, debug_level:debug_level})
								else if appName is in noResizeApp_R then
									if debug_level > 0 then
										log "move right"
										if debug_level > 1 then
											display dialog "move right"
										end if
									end if
									windowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_R, monPosY:dPosY_R, resize:0, moveForMon:false, debug_level:debug_level})
								else if appName is in app_L then
									if debug_level > 0 then
										log "move left full size"
										if debug_level > 1 then
											display dialog "move left full size"
										end if
									end if
									windowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_L, monPosY:dPosY_L, moveForMon:false, debug_level:debug_level})
								else if appName is in app_R then
									if debug_level > 0 then
										log "move right full size"
										if debug_level > 1 then
											display dialog "move right full size"
										end if
									end if
									windowSize's windowSize({appName:appName, windowNumber:i, monPosX:dPosX_R, monPosY:dPosY_R, moveForMon:false, debug_level:debug_level})
								end if
							end repeat
						end tell
					end try
				end tell
			end if
		end repeat
	end if
end moveForMon

on run
	moveForMon({})
end run


[TIMOB-11554] wait for Organizer window to open

FasdUAS 1.101.10
k
lTN
Open organizer script. Descended from apple's "Probe Menu Bar" sample script

Open organizer script. Descended from apple's "Probe Menu Bar" sample script

l
O

Z
1

uien
k
l1+tell application xcode_app_name to activateVtell application xcode_app_name to activate
O
k
r
m
boovtrue
1

pisf !
 I""#
.prcskprsnullutxt
"m$$%%2#&

faal
&J''()
(m
eMdsKsft)*
*m
eMdsKcmd!+,
+T#P-
-k(K../0
/Q(E12
1Z+<34
3@+456
5l+27
7I+28
.corecnte********
82+.

cwin
6m23
4S78
2R
.ascrerr ********09
9IFK:
.sysodelanullnmbr
:mFG;;?ə,<=
<rQY>?
>4QU@

cwin
@mST
?o
0	organizer=A
AZZBC
B>ZeDE
DlZaF
FnZaGH
G1]a

titl
HoZ]
0	organizer
EmadIIJJ(Organizer - Archives
CkhKKLM
LIh{N
.prcsclicuieluiel
NnhwOP
O4pwQ

butT
QmsvRRSSArchives
PnhpTU
T4kpV

tbar
Vmno
Uohk
0	organizerMWX
WI|Y
.sysodelanullnmbr
Ym|ZZ?X[
[r\]
\4^

cwin
^m
]o
0	organizer
4_

prcs
_m
``aa
Xcode
Obc
bkddef
eI
.miscactvnullnullfgh
grij
i4k

xppb
kmllmmHcom.apple.preference.universalaccess
j1

xpcphn
nIo
.sysodlogaskrTEXT
omppqqUI element scripting is not enabled. Check "Enable access for assistive devices"
cmrrsprfalis~Macintosh HD2}H+System Preferences.app(?	 Applications3
(1Macintosh HD:Applications:System Preferences.app.System Preferences.appMacintosh HD#Applications/System Preferences.app/
msssevsalisMacintosh HD2}H+System Events.app	 CoreServices3
 PBwv=Macintosh HD:System:Library:CoreServices:System Events.app$System Events.appMacintosh HD-System/Library/CoreServices/System Events.app/t
tluvu
.aevtoappnull****vwxy
.aevtoappnull****
wkzz
xys`$;IRZrlp

uien

prcs

pisf

faal
eMdsKsft
eMdsKcmd
.prcskprsnullutxt

cwin
.corecnte********
.sysodelanullnmbr
0	organizer

titl

tbar

butT
.prcsclicuieluiel
.miscactvnullnull

xppb

xpcp
.sysodlogaskrTEXT*,E*/e*,FOlvl	O,hZ*-jkYhWX
hOj[OYO*k/E`O_a,a)_ak/aa/jOajO*k/E`YhUY%a*jO*aa/*a,FOajUUascr
ޭ

FasdUAS 1.101.10
k
lTN
Open organizer script. Descended from apple's "Probe Menu Bar" sample script

Open organizer script. Descended from apple's "Probe Menu Bar" sample script

l
O

Z
1

uien
k[
l1+tell application xcode_app_name to activateVtell application xcode_app_name to activate
O[
kZ
r
m
boovtrue
1

pisf !
 I""#
.prcskprsnullutxt
"m$$%%2#&

faal
&J''()
(m
eMdsKsft)*
*m
eMdsKcmd!+,
+I#(-
.sysodelanullnmbr
-m#$..?,/0
/r)/12
14)-3

cwin
3m+,
2o
0	organizer04
4Z0Z56
5>0578
7l039
9n03:;
:113

titl
;o01
0	organizer
8m34<<==(Organizer - Archives
6k8V>>?@
?I8IA
.prcsclicuieluiel
An8EBC
B4>ED

butT
DmADEEFFArchives
Cn8>GH
G49>I

tbar
Im<=
Ho89
0	organizer@JK
JIJOL
.sysodelanullnmbr
LmJKMM?KN
NrPVOP
O4PTQ

cwin
QmRS
Po
0	organizer
4R

prcs
Rm
SSTT
Xcode
O^UV
UkdWWXY
XIdi
.miscactvnullnullYZ[
Zrjx\]
\4jr^

xppb
^mnq__``Hcom.apple.preference.universalaccess
]1rw

xpcp[a
aIyb
.sysodlogaskrTEXT
bmy|ccddUI element scripting is not enabled. Check "Enable access for assistive devices"
Vm^aeesprfalisnMac SSDG5H+jSystem Preferences.app6S	 ApplicationsGj,Mac SSD:Applications:System Preferences.app.System Preferences.appMac SSD#Applications/System Preferences.app/
mffsevsalisMac SSDG5H+MSystem Events.app0Y	 CoreServicesGMGF8Mac SSD:System:Library:CoreServices:System Events.app$System Events.appMac SSD-System/Library/CoreServices/System Events.app/g
glhijh
.aevtoappnull****
0	organizeriklm
.aevtoappnull****
kknn
lmfS$.<Ee_c

uien

prcs

pisf

faal
eMdsKsft
eMdsKcmd
.prcskprsnullutxt
.sysodelanullnmbr

cwin
0	organizer

titl

tbar

butT
.prcsclicuieluiel
.miscactvnullnull

xppb

xpcp
.sysodlogaskrTEXT*,EU*/Je*,FOlvl	OjO*k/EO,#ak/aa/jOjO*k/EYhUY%a*jO*aa/*a,FOajUUjoopqpfr

pcaprss
Xcode

cwinqtt(Organizer - Archivesascrޭ


Set terminal font to source code pro.

Set terminal font to source code pro.

(* This script is adapted from
   https://github.com/mathiasbynens/dotfiles/blob/master/.macos.

   I have mainly added more explicit handling of the path to the custom theme
   file and the ability to set the font. *)

tell application "Terminal"

    local allOpenedWindows
    local initialOpenedWindows
    local windowID

    (* Set the fully qualified path to the .terminal file. We'll need to
       refer to the theme name separately though. *)
    set themeName to "Solarized Dark"
    set themePath to (system attribute "HOME") & "/.config/themes/osx-terminal.app-colors-solarized/"
    set themeFile to themePath & themeName & ".terminal"

    (* Set our desired font. *)
    set fontName to "SourceCodePro-Regular"
    set fontSize to 12

    (* Store the IDs of all the open terminal windows. *)
    set initialOpenedWindows to id of every window

    (* Open the custom theme so that it gets added to the list of  available
       terminal themes. Note: this will open an additional terminal window. *)
    do shell script "open '" & themeFile & "'"

    (* Wait a little bit to ensure that the custom theme is added. *)
    delay 1

    (* Modify the custom theme to set our desired font. *)
    set font name of settings set themeName to fontName
    set font size of settings set themeName to fontSize

    (* Set the custom theme as the default terminal theme. *)
    set default settings to settings set themeName

    (* Get the IDs of all the currently opened terminal windows. *)
    set allOpenedWindows to id of every window

    repeat with windowID in allOpenedWindows

        (* Close the additional windows that were opened in order to add the
           custom theme to the list of terminal themes. *)
        if initialOpenedWindows does not contain windowID then
            close (every window whose id is windowID)

        (* Change the theme for the initial opened terminal windows to remove
           the need to close them in order for the custom theme to be applied. *)
        else
            set current settings of tabs of (every window whose id is windowID) to settings set themeName
        end if
    end repeat
end tell

(* This script is adapted from
   https://github.com/mathiasbynens/dotfiles/blob/master/.macos.

   I have mainly added more explicit handling of the path to the custom theme
   file and the ability to set the font. *)

tell application "Terminal"

    local allOpenedWindows
    local initialOpenedWindows
    local windowID

    (* Set the fully qualified path to the .terminal file. We'll need to
       refer to the theme name separately though. *)
    set themeName to "Solarized Dark"
    set themePath to (system attribute "HOME") & "/.config/themes/osx-terminal.app-colors-solarized/"
    set themeFile to themePath & themeName & ".terminal"

    (* Set our desired font. *)
    set fontName to "SauceCodePowerline-Medium"
    set fontSize to 12

    (* Store the IDs of all the open terminal windows. *)
    set initialOpenedWindows to id of every window

    (* Open the custom theme so that it gets added to the list of  available
       terminal themes. Note: this will open an additional terminal window. *)
    do shell script "open '" & themeFile & "'"

    (* Wait a little bit to ensure that the custom theme is added. *)
    delay 1

    (* Modify the custom theme to set our desired font. *)
    set font name of settings set themeName to fontName
    set font size of settings set themeName to fontSize

    (* Set the custom theme as the default terminal theme. *)
    set default settings to settings set themeName

    (* Get the IDs of all the currently opened terminal windows. *)
    set allOpenedWindows to id of every window

    repeat with windowID in allOpenedWindows

        (* Close the additional windows that were opened in order to add the
           custom theme to the list of terminal themes. *)
        if initialOpenedWindows does not contain windowID then
            close (every window whose id is windowID)

        (* Change the theme for the initial opened terminal windows to remove
           the need to close them in order for the custom theme to be applied. *)
        else
            set current settings of tabs of (every window whose id is windowID) to settings set themeName
        end if
    end repeat
end tell


Create a new tab when iTerm already has a window, otherwise create a new window

FasdUAS 1.101.10
k
i
I	0openinitermopenIniTerm

o0	thefolder	theFolder
OH
kG

r
1

Crwn
o0t
Q
*
O

I
.Itrmntwpnullobj

Ntwp
mDefault
l

1

Crwn
R
.ascrerr ********
o0mg
r#*
I#(
.Itrmnwwnnullnull
 o0t!"
!O+A#$
#I1@%
.Itrmsntxnullobj %&

Text
&b3<'(
'b3:)*
)m34++,,cd
*n49-.
-179

strq
.n47/0
/157

psxp
0o450	thefolder	theFolder
(m:;1122;clear;
$l+.3
3n+.45
41,.

Wcsn
5o+,0t"6
6IBG
.miscactvnullnull
m77ITRMalisHMacintosh HD
|H+G	iTerm.app5q	 Applications	5FG$Macintosh HD:Applications:iTerm.app	iTerm.appMacintosh HDApplications/iTerm.app/89
8l9:
:i;<
;I
.aevtoappnull****
<k*==>?
>O#@A
@Q"BCD
BrEF
ElG
GcHI
Hn
JK
Jm

cfol
KlL
L4M

cwin
Mm

Im

alis
Fo0	thefolder	theFolder
CR
.ascrerr ********
Dr"NO
Nl P
PI QR
.earsffdralis afdr
Qm
afdmdeskRS

rtyp
Sm

alis
Oo0	thefolder	theFolder
AmTTMACSalistMacintosh HD
|H+'
Finder.appw	 CoreServices	o'&%6Macintosh HD:System:Library:CoreServices:Finder.app
Finder.appMacintosh HD&System/Library/CoreServices/Finder.app/?U
UI$*V0openinitermopenIniTermVW
Wo%&0	thefolder	theFolderXYZX0openinitermopenIniTerm
.aevtoappnull****Y[\0openinitermopenIniTerm]]0	thefolder	theFolder[0	thefolder	theFolder0t0mg\7+1

Crwn

Ntwp
.Itrmntwpnullobj 0mg
.Itrmnwwnnullnull

Wcsn

Text

psxp

strq
.Itrmsntxnullobj
.miscactvnullnullIE*,EO*,	*lUWX*jEO,*,,%%lUO*jUZ<^_
.aevtoappnull****^_T

cwin

cfol

alis0	thefolder	theFolder
afdmdesk

rtyp
.earsffdralis afdr0openinitermopenIniTerm+ *k/,&EWXl	EUO*k+
ascr
ޭ

FasdUAS 1.101.10
k
i
I	0openinitermopenIniTerm

o0	thefolder	theFolder
O)
k(

r
I
.Itrmnwwnnullnull
o0t
l
O"
I!
.Itrmsntxnullobj

Text
b
b
mcd
n !
 1

strq
!n"#
"1

psxp
#o0	thefolder	theFolder
m$$%%;clear;
l&
&n'(
'1

Wcsn
(o
0t)
)I#(
.miscactvnullnull
m**ITRMalisHMacintosh HD\H+	iTerm.appbnA	 Applications\Ag$Macintosh HD:Applications:iTerm.app	iTerm.appMacintosh HDApplications/iTerm.app/+,
+l,-
-i./
.I
.aevtoappnull****
/k*0012
1O#34
3Q"567
5r89
8l:
:c;<
;n
=>
=m

cfol
>l?
?4@

cwin
@m

<m

alis
9o0	thefolder	theFolder
6R
.ascrerr ********
7r"AB
Al C
CI DE
.earsffdralis afdr
Dm
afdmdeskEF

rtyp
Fm

alis
Bo0	thefolder	theFolder
4mGGMACSalistMacintosh HD\H+
Finder.appw	 CoreServices\Agvn6Macintosh HD:System:Library:CoreServices:Finder.app
Finder.appMacintosh HD&System/Library/CoreServices/Finder.app/2H
HI$*I0openinitermopenIniTermIJ
Jo%&0	thefolder	theFolderKLMNK0openinitermopenIniTerm
.aevtoappnull****0	thefolder	theFolderLOP0openinitermopenIniTermQQ0	thefolder	theFolderO0	thefolder	theFolder0tP
*$
.Itrmnwwnnullnull

Wcsn

Text

psxp

strq
.Itrmsntxnullobj
.miscactvnullnull*&*jEO,*,,%%lUO*j	UM/RS
.aevtoappnull****RSG

cwin

cfol

alis0	thefolder	theFolder
afdmdesk

rtyp
.earsffdralis afdr0openinitermopenIniTerm+ *k/,&EWXl	EUO*k+
Nd
alis`Macintosh HD\H+	zus_parse[ժ	 Desktop\Ag[e*	Cg+Macintosh HD:Users:lex:Desktop:zus_parse	zus_parseMacintosh HDUsers/lex/Desktop/zus_parse/
ascrޭ


moveForMon.applescript, from darwin13

moveForMon.applescript, from darwin13


Updated load order script

Updated load order script


Updated Snak AppleScript to behave properly for 0.6

--HG--
extra : convert_revision : svn%3A99687598-2e92-11dd-8019-fe7b9d601d1b/trunk%401899

FasdUAS 1.101.10
k
i
I0
registergrowl
registerGrowl
k

r

J
mPublic Message
mPrivate Message

o0allnotesallNotes
O
I
.registernullnull

appl
m

Snak

anot
o0allnotesallNotes

dnot
o0allnotesallNotes

iapp
m
Snak
m!!"nullaa;GrowlHelperApp.appL7P@)(K pGRRRalisWideBoy.1H+a3GrowlHelperApp.appa8v	 	Resources.1va3a2a1	TWideBoy:Library:PreferencePanes:Growl.prefPane:Contents:Resources:GrowlHelperApp.app&GrowlHelperApp.appWideBoyLLibrary/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app/"#
"l#$%
$l%&'
&i()
(I*
0pubmsg*+,
+o0con,-.
-o
0source./0
/o0
sourcehost012
1o
0target23
3o
0	thestring
)k4456
5l678
7l89:
9l;;VP################################################################################:<=
<l>>4.########	Edit these values to suit your wishes=?@
?lAAVP################################################################################@BC
BlCDE
DlFF:4 set ChannelsToMonitor to {"#example1", "#example2"}EGH
GlII/) set keywords to {"keyword1", "keyword2"}HJK
JrLM
LJ
Mo&0channelstomonitorChannelsToMonitorKNO
Nr	PQ
PJ
Qo0keywordsORS
Rl

STU
Tl

VVSM Set to false to popup notifications even when snak is the active applicationUWX
Wr

YZ
Ym

boovtrue
Zo00notifyinbackgroundonlyNotifyInBackgroundOnlyX[\
[l\]^
]l__VP################################################################################^`a
`lbb######### 	End Editable Regionacd
cleeWQ################################################################################	dfg
flghi
hlijk
jlklm
llnn)# Get the name of the topmost windowmop
oO$qr
qr#st
s6!uv
unwx
w1

pnam
x4y

prcs
ym
v= z{
z1

pisf
{m
boovtrue
to"0nameofactiveappNameOfActiveApp
rm||null

Finder.app΀0L7ΰp)(K MACSalisbWideBoy.1H+

Finder.app2	 CoreServices.1

.WideBoy:System:Library:CoreServices:Finder.app
Finder.appWideBoy&System/Library/CoreServices/Finder.app/p}~
}l%%~
l%%
l%%$ Get your current irc nickname
O%2
r)1
n)/
1-/

NICK
4)-

CONN
o+,0con
o
0mynick
m%&nullA߸`baSnakQP0L7ՀZ()(K ՠSNpaalisZWideBoy.1H+`baSnak`bۺtMt	 	Snak 4.13.1tM`ba|,WideBoy:Users:diggory:Desktop:Snak 4.13:Snak
SnakWideBoy$Users/diggory/Desktop/Snak 4.13/Snak/
l33
l33
l33NH First, make sure we are either focused on another app, or we want to be
l33'! notified even if Snak is on top
Z3
G3>
l36
>36
o34"0nameofactiveappNameOfActiveApp
m45
Snak
l9<
=9<
o9:00notifyinbackgroundonlyNotifyInBackgroundOnly
m:;
boovfals
kA
lAA
lAA
lAAa[ Make sure the message's target is in ChannelsToMonitor, or that ChannelsToMonitor is empty
ZA
lAN
GAN
EAD
oAB&0channelstomonitorChannelsToMonitor
oBC
0target
=GL
nGJ
1HJ

leng
oGH&0channelstomonitorChannelsToMonitor
mJK
kQ
lQQ
lQQHB if keywords is empty, we're successful and we display the message
lQQNH otherwise, only set success if the message contains one of our keywords
ZQ
lQV
=QV
nQT
1RT

leng
oQR0keywords
mTU
rY\
mYZ
boovtrue
o0keywordmatchkeywordMatch
k_
r_b
m_`
boovfals
o0keywordmatchkeywordMatch
Xc
Zs
lsv
Esv
ost
0	thestring
otu0thiskeywordthisKeyword
ry|
myz
boovtrue
o0keywordmatchkeywordMatch0thiskeywordthisKeyword
lfg
ofg0keywords
l
l;5 if the message contains our nick, we will display it
Z
l~
E
o}}
0	thestring
o||
0mynick~
r
m{
{boovtrue
ozz0keywordmatchkeywordMatchy
lxwxwy
lvuvu
lttmg If the message is coming from a valid channel, and we got success in matching either keywords or nick,
lss display an alert
Zrq
lp
=
ooo0keywordmatchkeywordMatch
mn
nboovtruep
k
n
Imlkm0
registergrowl
registerGrowllk
fj
O
Iih
i.notifygrnullnullhg
g
titl
l	f
	b

b

oee
0source

m:
odd
0targetfc
c
desc
lb
oaa
0	thestringb`
`
appl
m
Snak_^
_
name
mPublic Message^
m!jrq]
l\[\[]
lZYZYX
lWVWVX
lUTUTS
L
mR
RboovfalsS'
lQPQP !"
!lO#O#(" Log all private messages to growl"$%
$i&'
&IN(MN0privmsg()*
)oLL0con*+,
+oKK
0source,-.
-oJJ0
sourcehost./0
/oII
0target01H
1oGG
0	thestringHM
'kI2234
3lFEFE456
5lD7D7.( Get the name of the topmost application689
8O:;
:r<=
<6>?
>n
@A
@1
C
C
pnam
A4BB
B
prcs
BmAA
?=CD
C1@
@
pisf
Dm?
?boovtrue
=o>>"0nameofactiveappNameOfActiveApp
;m|9EF
El=<=<FGH
GZGIJ;:
IG"KL
KlM9
M>NO
No88"0nameofactiveappNameOfActiveApp
OmPP
Snak9
Ll Q7
Q= RS
Ro6600notifyinbackgroundonlyNotifyInBackgroundOnly
Sm5
5boovfals7
Jk%CTTUV
Un%*WX
WI&*43240
registergrowl
registerGrowl32
Xf%&VY1
YO+CZ[
ZI/B0/\
0.notifygrnullnull/\.]^
.
titl
]l16_-
_b16`a
`b14bc
bo12,,
0source
cm23dd:
ao45++
0target-^*ef
*
desc
el78g)
go78((
0	thestring)f'hi
'
appl
hm9:jj
Snaki&k%
&
name
km;<llPrivate Message%
[m+,!1;:Hm$
mlHH#"#"$%n!
nl  !opqro0
registergrowl
registerGrowl
0pubmsg0privmsgpst0
registergrowl
registerGrowls0allnotesallNotest!

appl

anot

dnot

iapp
.registernullnulllvEO*
Uq)
uv
0pubmsgww

0con
0source0
sourcehost
0target
0	thestring
u0con
0source0
sourcehost
0target
0	thestring&0channelstomonitorChannelsToMonitor0keywords00notifyinbackgroundonlyNotifyInBackgroundOnly"0nameofactiveappNameOfActiveApp
0mynick0keywordmatchkeywordMatch0thiskeywordthisKeywordv|x!

prcs

pnamx

pisf

CONN

NICK

bool

leng

kocl

cobj
.corecnte********0
registergrowl
registerGrowl

titl

desc

appl

name
.notifygrnullnulljvEOjvEOeEO*k/,[,\Ze81EUO
*/,EUO
f&
	,j&,jeEY8fEO![l
kheEYh[OYOeEYhOPOe1)j+O#*aa%%aaaaaaUYhOPYhOPYhOfr'yz0privmsg{{0con
0source0
sourcehost
0target
0	thestringy0con
0source0
sourcehost
0target
0	thestring"0nameofactiveappNameOfActiveApp00notifyinbackgroundonlyNotifyInBackgroundOnlyz|xP!djl

prcs

pnam

pisf

bool0
registergrowl
registerGrowl

titl

desc

appl

name
.notifygrnullnullJ*k/,[,\Ze81EUO
f&#)j+O*%%aUYhOPascrޭ

FasdUAS 1.101.10
k
i
I
0pubmsg

o0con

o
0source

o0
sourcehost
o
0target
o
0	thestring
k
l
l
lVP################################################################################
l4.########	Edit these values to suit your wishes
l  VP################################################################################!"
!l"#$
#l%%:4 set ChannelsToMonitor to {"#example1", "#example2"}$&'
&l((/) set keywords to {"keyword1", "keyword2"}')*
)r+,
+J
,o&0channelstomonitorChannelsToMonitor*-.
-r	/0
/J
0o0keywords.12
1l

234
3l

55SM Set to false to popup notifications even when snak is the active application467
6r

89
8m

boovtrue
9o00notifyinbackgroundonlyNotifyInBackgroundOnly7:;
:l;<=
<l>>VP################################################################################=?@
?lAA######### 	End Editable Region@BC
BlDDWQ################################################################################	CEF
ElFGH
GlHIJ
IlJKL
KlMM)# Get the name of the topmost windowLNO
NO$PQ
Pr#RS
R6!TU
TnVW
V1

pnam
W4X

prcs
Xm
U= YZ
Y1

pisf
Zm
boovtrue
So"0nameofactiveappNameOfActiveApp
Qm[[null%
Finder.appؠ07()( MACSalisbPanther4jH+%
Finder.app4$Je	 CoreServices4i%.Panther:System:Library:CoreServices:Finder.app
Finder.appPanther&System/Library/CoreServices/Finder.app/O\]
\l%%]^_
^l%%_`a
`l%%bb$ Get your current irc nicknameacd
cO%2ef
er)1gh
gn)/ij
i1-/

NICK
j4)-k

CONN
ko+,0con
ho
0mynick
fm%&llnullA߸&Snakp
ؠ07r,()( SNpaalis*Panther4jH+&SnaktM/
?	 Snak4itm&gPanther:Applications:Snak:Snak
SnakPantherApplications/Snak/Snak/dmn
ml33nop
ol33pqr
ql33ssNH First, make sure we are either focused on another app, or we want to bertu
tl33vv'! notified even if Snak is on top	uwx
wZ3yz
yG3>{|
{l36}
}>36~
~o34"0nameofactiveappNameOfActiveApp
m45
Snak
|l9<
=9<
o9:00notifyinbackgroundonlyNotifyInBackgroundOnly
m:;
boovfals
zkA
lAA
lAA
lAAa[ Make sure the message's target is in ChannelsToMonitor, or that ChannelsToMonitor is empty
ZA
lAN
GAN
EAD
oAB&0channelstomonitorChannelsToMonitor
oBC
0target
=GL
nGJ
1HJ

leng
oGH&0channelstomonitorChannelsToMonitor
mJK
kQ
lQQ
lQQHB if keywords is empty, we're successful and we display the message
lQQNH otherwise, only set success if the message contains one of our keywords
ZQ
lQV
=QV
nQT
1RT

leng
oQR0keywords
mTU
rY\
mYZ
boovtrue
o0keywordmatchkeywordMatch
k_
r_b
m_`
boovfals
o0keywordmatchkeywordMatch
Xc
Zs
lsv
Esv
ost
0	thestring
otu0thiskeywordthisKeyword
ry|
myz
boovtrue
o0keywordmatchkeywordMatch0thiskeywordthisKeyword
lfg
ofg0keywords
l
l;5 if the message contains our nick, we will display it
Z
l
E
o
0	thestring
o
0mynick
r
m
boovtrue
o0keywordmatchkeywordMatch
l
l
lmg If the message is coming from a valid channel, and we got success in matching either keywords or nick,
l display an alert
Z
l
=
o0keywordmatchkeywordMatch
m
boovtrue
O
I
.notifygrnullnull~
~
titl
b
b
o}}
0source
m:
o||
0target{
{
desc
ozz
0	thestringyx
y
iapp
m/Applications/Snak/Snakx
mLnullaGrowlHelperApp.app7@)( GRRRalisPanther4jH+BGrowlHelperApp.appDÚ	 	Resources4i4BA@9mQmP]bPanther:Users:justinb:Library:PreferencePanes:Growl.prefPane:Contents:Resources:GrowlHelperApp.app&GrowlHelperApp.appPantherZUsers/justinb/Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app/w
lvuvuw
ltstsr
lqpqprx
lononm
L
ml
lboovfalsm
lkjkj
lii(" Log all private messages to growlh
i
Igfg0privmsg
oee0con
odd
0source
occ0
sourcehost
obb
0targeta
o``
0	thestringaf
k?
l_^_^

	l]].( Get the name of the topmost application

O
r
6
n

1
\
\
pnam
4[
[
prcs
mZZ
=
1Y
Y
pisf
mX
Xboovtrue
oWW"0nameofactiveappNameOfActiveApp
m[

lVUVU
Z=TS
G"
l!R
!>"#
"oQQ"0nameofactiveappNameOfActiveApp
#m$$
SnakR
 l %P
%= &'
&oOO00notifyinbackgroundonlyNotifyInBackgroundOnly
'mN
NboovfalsP
O%9()
(I)8ML*
M.notifygrnullnullL*K+,
K
titl
+b+0-.
-b+./0
/o+,JJ
0target
0m,-11:
.o./II
0source,H23
H
desc
2o12GG
0	thestring3F4E
F
iapp
4m3455Snak.appE
)m%&TS6D
6l>>CBCBDhA789A7@?@
0pubmsg?0privmsg8>=<:;;>
0pubmsg=:<:<9876590con8
0source70
sourcehost6
0target5
0	thestring<:43210/.-,+*)40con3
0source20
sourcehost1
0target0
0	thestring/&0channelstomonitorChannelsToMonitor.0keywords-00notifyinbackgroundonlyNotifyInBackgroundOnly,"0nameofactiveappNameOfActiveApp+
0mynick*0keywordmatchkeywordMatch)0thiskeywordthisKeyword;[('=&l%$#"!
(
prcs
'
pnam=
&
pisf
%
CONN
$
NICK
#
bool
"
leng
!
kocl

cobj
.corecnte********

titl

desc

iapp
.notifygrnullnull;jvEOjvEOeEO*k/,[,\Ze81EUO
*/,EUO
f&
	,j&t,jeEY8fEO![l
kheEYh[OYOeEYhOPOe#*a%%aaaaUYhOPYhOPYhOf9>?0privmsg@@0con
0source0
sourcehost
0target
0	thestring>

	0con
0source
0
sourcehost
0target
0	thestring
"0nameofactiveappNameOfActiveApp	00notifyinbackgroundonlyNotifyInBackgroundOnly?[=$15

prcs

pnam

pisf

bool

titl

desc

iapp
.notifygrnullnull@*k/,[,\Ze81EUO
f&*%%UYhOPascrޭ


fix a typo in uninstaller message

fix a typo in uninstaller message

property stdout : ""
on run
	set newline to ASCII character 10

	set stdout to stdout & "  shutdown TotalFinderCrashWatcher ..." & newline
	try
		do shell script "killall -SIGINT TotalFinderCrashWatcher" with administrator privileges
	on error
		set stdout to stdout & "    TotalFinderCrashWatcher not running" & newline
	end try

	set stdout to stdout & "  shutdown Finder ..." & newline
	try
		tell application "Finder" to quit
	on error
		set stdout to stdout & "    Finder was not running prior uninstallation" & newline
	end try

	set stdout to stdout & "  remove TotalFinder.app from login items ..." & newline
	try
		tell application "System Events"
			get the name of every login item
			if login item "TotalFinder.app" exists then
				delete login item "TotalFinder.app"
			end if
		end tell
	on error
		set stdout to stdout & "    Encountered problems when removing TotalFinder.app from login items"
	end try

	-- old version
	set stdout to stdout & "  removing the old TotalFinder files (0.8.2 and earlier) ..." & newline
	try
		do shell script "sudo launchctl unload -w \"/Library/LaunchDaemons/com.binaryage.echelon.launcher.plist\"" with administrator privileges
	end try
	try
		do shell script "sudo rm -f \"/Library/LaunchDaemons/com.binaryage.echelon.launcher.plist\"" with administrator privileges
	end try
	try
		do shell script "sudo kextunload \"/System/Library/Extensions/echelon.kext\"" with administrator privileges
	end try
	try
		do shell script "sudo rm -rf \"/System/Library/Extensions/echelon.kext\"" with administrator privileges
	end try
	try
		do shell script "sudo rm -rf \"/Library/Application Support/SIMBL/Plugins/TotalFinder.bundle\"" with administrator privileges
	end try

	-- new version
	set stdout to stdout & "  unload TotalFinder.kext ..." & newline
	try
		do shell script "sudo kextunload \"/System/Library/Extensions/TotalFinder.kext\"" with administrator privileges
	on error
		set stdout to stdout & "    TotalFinder.kext not loaded" & newline
	end try

	set stdout to stdout & "  remove TotalFinder.app ..." & newline
	try
		do shell script "sudo rm -rf \"/Applications/TotalFinder.app\"" with administrator privileges
	on error
		set stdout to stdout & "    unable to remove /Applications/TotalFinder.app" & newline
	end try

	set stdout to stdout & "  remove TotalFinder.kext ..." & newline
	try
		do shell script "sudo rm -rf \"/System/Library/Extensions/TotalFinder.kext\"" with administrator privileges
	on error
		set stdout to stdout & "    unable to remove /System/Library/Extensions/TotalFinder.kext" & newline
	end try

	set stdout to stdout & "  remove TotalFinder.osax ..." & newline
	try
		do shell script "sudo rm -rf \"/Library/ScriptingAdditions/TotalFinder.osax\"" with administrator privileges
	on error
		set stdout to stdout & "    unable to remove /Library/ScriptingAdditions/TotalFinder.osax" & newline
	end try

	set stdout to stdout & "  enable Finder animations again ..." & newline
	try
		do shell script "defaults write com.apple.finder DisableAllAnimations -bool false" with administrator privileges
		do shell script "defaults write com.apple.finder AnimateWindowZoom -bool true" with administrator privileges
		do shell script "defaults write com.apple.finder FXDisableFancyWindowTransition -bool false" with administrator privileges
	on error
		set stdout to stdout & "    unable to enable animations back" & newline
	end try

	set stdout to stdout & "  hide system files in Finder again ..." & newline
	try
		do shell script "defaults write com.apple.finder AppleShowAllFiles -bool false" with administrator privileges
	on error
		set stdout to stdout & "    hide system files in Finder back" & newline
	end try

	set stdout to stdout & "  relaunch Finder ..." & newline
	try
		tell application "Finder" to launch
	on error
		set stdout to stdout & "    failed to relaunch Finder" & newline
	end try

	-- at this point Finder should start cleanly and with no signs of TotalFinder
	-- you may check Events/Replies tab to see if there were no issues with uninstallation

	stdout -- this is needed for platypus to display output in details window
end run

property stdout : ""
on run
	set newline to ASCII character 10

	set stdout to stdout & "  shutdown TotalFinderCrashWatcher ..." & newline
	try
		do shell script "killall -SIGINT TotalFinderCrashWatcher" with administrator privileges
	on error
		set stdout to stdout & "    TotalFinderCrashWatcher.com not running" & newline
	end try

	set stdout to stdout & "  shutdown Finder ..." & newline
	try
		tell application "Finder" to quit
	on error
		set stdout to stdout & "    Finder was not running prior uninstallation" & newline
	end try

	set stdout to stdout & "  remove TotalFinder.app from login items ..." & newline
	try
		tell application "System Events"
			get the name of every login item
			if login item "TotalFinder.app" exists then
				delete login item "TotalFinder.app"
			end if
		end tell
	on error
		set stdout to stdout & "    Encountered problems when removing TotalFinder.app from login items"
	end try

	-- old version
	set stdout to stdout & "  removing the old TotalFinder files (0.8.2 and earlier) ..." & newline
	try
		do shell script "sudo launchctl unload -w \"/Library/LaunchDaemons/com.binaryage.echelon.launcher.plist\"" with administrator privileges
	end try
	try
		do shell script "sudo rm -f \"/Library/LaunchDaemons/com.binaryage.echelon.launcher.plist\"" with administrator privileges
	end try
	try
		do shell script "sudo kextunload \"/System/Library/Extensions/echelon.kext\"" with administrator privileges
	end try
	try
		do shell script "sudo rm -rf \"/System/Library/Extensions/echelon.kext\"" with administrator privileges
	end try
	try
		do shell script "sudo rm -rf \"/Library/Application Support/SIMBL/Plugins/TotalFinder.bundle\"" with administrator privileges
	end try

	-- new version
	set stdout to stdout & "  unload TotalFinder.kext ..." & newline
	try
		do shell script "sudo kextunload \"/System/Library/Extensions/TotalFinder.kext\"" with administrator privileges
	on error
		set stdout to stdout & "    TotalFinder.kext not loaded" & newline
	end try

	set stdout to stdout & "  remove TotalFinder.app ..." & newline
	try
		do shell script "sudo rm -rf \"/Applications/TotalFinder.app\"" with administrator privileges
	on error
		set stdout to stdout & "    unable to remove /Applications/TotalFinder.app" & newline
	end try

	set stdout to stdout & "  remove TotalFinder.kext ..." & newline
	try
		do shell script "sudo rm -rf \"/System/Library/Extensions/TotalFinder.kext\"" with administrator privileges
	on error
		set stdout to stdout & "    unable to remove /System/Library/Extensions/TotalFinder.kext" & newline
	end try

	set stdout to stdout & "  remove TotalFinder.osax ..." & newline
	try
		do shell script "sudo rm -rf \"/Library/ScriptingAdditions/TotalFinder.osax\"" with administrator privileges
	on error
		set stdout to stdout & "    unable to remove /Library/ScriptingAdditions/TotalFinder.osax" & newline
	end try

	set stdout to stdout & "  enable Finder animations again ..." & newline
	try
		do shell script "defaults write com.apple.finder DisableAllAnimations -bool false" with administrator privileges
		do shell script "defaults write com.apple.finder AnimateWindowZoom -bool true" with administrator privileges
		do shell script "defaults write com.apple.finder FXDisableFancyWindowTransition -bool false" with administrator privileges
	on error
		set stdout to stdout & "    unable to enable animations back" & newline
	end try

	set stdout to stdout & "  hide system files in Finder again ..." & newline
	try
		do shell script "defaults write com.apple.finder AppleShowAllFiles -bool false" with administrator privileges
	on error
		set stdout to stdout & "    hide system files in Finder back" & newline
	end try

	set stdout to stdout & "  relaunch Finder ..." & newline
	try
		tell application "Finder" to launch
	on error
		set stdout to stdout & "    failed to relaunch Finder" & newline
	end try

	-- at this point Finder should start cleanly and with no signs of TotalFinder
	-- you may check Events/Replies tab to see if there were no issues with uninstallation

	stdout -- this is needed for platypus to display output in details window
end run


Solving issue #6. Some minor improvements.

The volume is now being correctly restored when an ad was the last
thing played by Spotify.

-- Setting the "playing" property to the constant returned by Spotify as a "player state" when it's playing.
property playing : constant ****kPSP
global currentVolume, currentTrackPopularity, currentTrackDuration, currentTrackPosition

if (isInLoginItems("SpotiFree", ":Applications:SpotiFree.app") = false) then -- Check if SpotiFree is login items.
	local dialogTitle, dialogMessage, dialogButtonYes, dialogButtonYes, spotifreeAppName, spotifreeAppPath
	set spotifreeAppName to "SpotiFree"
	set spotifreeAppPath to ":Applications:SpotiFree.app"
	set dialogTitle to "Open SpotiFree at login"
	set dialogMessage to "Do you want SpotiFree to run automatically on startup? You'll never notice it, seriously."
	set dialogButtonNo to "No, thanks"
	set dialogButtonYes to "OK"

	-- Run the dialog to a user.
	set runAtStartupQuestion to (display dialog dialogMessage with title dialogTitle with icon 1 buttons {dialogButtonNo, dialogButtonYes} default button 2)
	-- Assign the result to the variable runAtStartupAnswer.
	set runAtStartupAnswer to the button returned of runAtStartupQuestion
	-- Check if user agreed.
	if (runAtStartupAnswer = dialogButtonYes) then
		try
			-- Add SpotiFree to the Login Items.
			my addToLoginItems(spotifreeAppName, spotifreeAppPath)
		end try
	end if
end if

-- Repeat this entire block every .3 seconds. As set at the end.
repeat
	try
		if (isRunning() and isPlaying()) then -- Is Spotify running? Is it playing?
			tell application "Spotify"
				try
					-- Get the popularity of a current track and save it in a variable currentTrackPopularity.
					set currentTrackPopularity to popularity of current track
					-- Get the duration of current track and save it in a variable currentTrackDuration.
					set currentTrackDuration to duration of current track
				end try
			end tell

			-- Check if current track is an advertisement.
			if (isAnAd(currentTrackPopularity, currentTrackDuration)) then
				try
					tell application "Spotify"
						try
							-- Get the current sound volume from Spotify and save it in a variable currentVolume.
							set currentVolume to sound volume
							-- Get the current track position and save it in a variable currentTrackPosition.
							set currentTrackPosition to player position
						end try
					end tell

					-- Mute Spotify.
					mute()

					-- Wait until the end of an ad + 1 sec. Then go forward.
					delay currentTrackDuration - currentTrackPosition + 1
				end try

				try
					repeat
						tell application "Spotify"
							try
								-- Get the popularity of a current track and save it in a variable currentTrackPopularity.
								set currentTrackPopularity to popularity of current track
								-- Get the duration of current track and save it in a variable currentTrackDuration.
								set currentTrackDuration to duration of current track
								-- Get the current track position and save it in a variable currentTrackPosition.
								set currentTrackPosition to player position

							on error errorNumber
								-- Checking if Spotify returns "Cant get current track." error.  It's being thrown when there's no track after an ad.
								-- Happens when an ad has played after the last song on the playlist.
								if (errorNumber = -1728) then
									unmute(currentVolume)
									exit repeat
								end if
							end try
						end tell

						if (isAnAd(currentTrackPopularity, currentTrackDuration)) then -- Check if current track is not an advertisement.
							-- Wait until the end of an ad + 1 sec. Then go forward.
							delay currentTrackDuration - currentTrackPosition + 1
						else
							unmute(currentVolume)
							exit repeat
						end if
					end repeat
				end try

			end if

		end if
	end try
	delay 0.3
end repeat

on mute()
	try
		tell application "Spotify"
			try
				pause
				set sound volume to 0
				play
			end try
		end tell
	end try
end mute

on unmute(volume)
	tell application "Spotify"
		try
			-- Restore the volume to the level it was before muting.
			set sound volume to volume
		end try
	end tell
end unmute

on isAnAd(trackPopularity, trackDuration)
	try
		-- If current track's popularity is 0 and its duration is less then 40, then it's almost certainly an ad.
		if (trackPopularity = 0 and trackDuration < 40) then
			return true
		else
			return false
		end if
	end try
end isAnAd

on isPlaying()
	local playerState
	try
		tell application "Spotify"
			try
				-- Hook the variable playerState to Spotify's state (playing, paused etc.).
				set playerState to player state
			end try
		end tell
		-- Compare Spotify's state with a constant saved in the property on line 1.
		if playerState = playing then
			return true
		else
			return false
		end if
	end try

end isPlaying

on isRunning()
	local spotifyProcesses
	try
		tell application "System Events"
			try
				-- Check if there are any Spotify processes. Set to variable spotifyProcesses
				set spotifyProcesses to (count of (every process whose bundle identifier is "com.spotify.client"))
			end try
		end tell
		-- Check the variable spotifyProcesses, to see is Spotify running.
		if spotifyProcesses  0 then
			return true
		else
			return false
		end if
	end try
end isRunning

on isInLoginItems(appName)
	local allLoginItems
	try
		-- Get all apps in Login Items.
		tell application "System Events" to set allLoginItems to name of every login item as string
		-- Check if inputted app is in there.
		if appName is in allLoginItems then
			return true
		else
			return false
		end if
	end try
end isInLoginItems

on addToLoginItems(appName, appPath)
	local posixAppPath
	try
		-- Get the POSIX (Portable Operating System Interface) path of inputted appPath.
		set posixAppPath to POSIX path of alias appPath
		tell application "System Events"
			try
				-- Add inputted app to the Login Items.
				make login item at end with properties {path:posixAppPath, hidden:true}
			end try
		end tell
	end try
end addToLoginItems

-- Setting the "playing" property to the constant returned by Spotify as a "player state" when it's playing.
property playing : constant ****kPSP
global currentVolume, currentTrackPopularity, currentTrackDuration, currentTrackPosition

if (isInLoginItems("SpotiFree", ":Applications:SpotiFree.app") = false) then -- Check if SpotiFree is login items.
	local dialogTitle, dialogMessage, dialogButtonYes, dialogButtonYes, spotifreeAppName, spotifreeAppPath
	set spotifreeAppName to "SpotiFree"
	set spotifreeAppPath to ":Applications:SpotiFree.app"
	set dialogTitle to "Open SpotiFree at login"
	set dialogMessage to "Do you want SpotiFree to run automatically on startup? You'll never notice it, seriously."
	set dialogButtonNo to "No, thanks"
	set dialogButtonYes to "OK"

	-- Run the dialog to a user.
	set runAtStartupQuestion to (display dialog dialogMessage with title dialogTitle with icon 1 buttons {dialogButtonNo, dialogButtonYes} default button 2)
	-- Assign the result to the variable runAtStartupAnswer.
	set runAtStartupAnswer to the button returned of runAtStartupQuestion
	-- Check if user agreed.
	if (runAtStartupAnswer = dialogButtonYes) then
		try
			-- Add SpotiFree to the Login Items.
			my addToLoginItems(spotifreeAppName, spotifreeAppPath)
		end try
	end if
end if

-- Repeat this entire block every .3 seconds. As set at the end.
repeat
	try
		if (isRunning() and isPlaying()) then -- Is Spotify running? Is it playing?
			tell application "Spotify"
				try
					-- Get the popularity of a current track and save it in a variable currentTrackPopularity.
					set currentTrackPopularity to popularity of current track
				end try
				try
					-- Get the duration of current track and save it in a variable currentTrackDuration.
					set currentTrackDuration to duration of current track
				end try
			end tell

			-- Check if current track is an advertisement.
			if (isAnAd(currentTrackPopularity, currentTrackDuration)) then
				try
					tell application "Spotify"
						try
							-- Get the current sound volume from Spotify and save it in a variable currentVolume.
							set currentVolume to sound volume
						end try
						try
							-- Get the current track position and save it in a variable currentTrackPosition.
							set currentTrackPosition to player position
						end try
					end tell

					-- Mute Spotify.
					mute()

					-- Wait until the end of an ad. Then go forward.
					delay currentTrackDuration - currentTrackPosition + 1
				end try

				try
					repeat
						tell application "Spotify"
							try
								-- Get the popularity of a current track and save it in a variable currentTrackPopularity.
								set currentTrackPopularity to popularity of current track
							end try
							try
								-- Get the duration of current track and save it in a variable currentTrackDuration.
								set currentTrackDuration to duration of current track
							end try
							try
								-- Get the current track position and save it in a variable currentTrackPosition.
								set currentTrackPosition to player position
							end try
						end tell

						if (isAnAd(currentTrackPopularity, currentTrackDuration) = false) then -- Check if current track is not an advertisement.
							unmute(currentVolume)
							exit repeat
						else
							delay currentTrackDuration - currentTrackPosition + 1
						end if
					end repeat
				end try

			end if

		end if
	end try
	delay 0.3
end repeat

on mute()
	try
		tell application "Spotify"
			try
				pause
				set sound volume to 0
				play
			end try
		end tell
	end try
end mute

on unmute(volume)
	tell application "Spotify"
		try
			-- Restore the volume to the level it was before muting.
			set sound volume to volume
		end try
	end tell
end unmute

on isAnAd(trackPopularity, trackDuration)
	try
		-- If current track's popularity is 0 and its duration is less then 40, then it's almost certainly an ad.
		if (trackPopularity = 0 and trackDuration < 40) then
			return true
		else
			return false
		end if
	end try
end isAnAd

on isPlaying()
	local playerState
	try
		tell application "Spotify"
			try
				-- Hook the variable playerState to Spotify's state (playing, paused etc.).
				set playerState to player state
			end try
		end tell
		-- Compare Spotify's state with a constant saved in the property on line 1.
		if playerState = playing then
			return true
		else
			return false
		end if
	end try

end isPlaying

on isRunning()
	local spotifyProcesses
	try
		tell application "System Events"
			try
				-- Check if there are any Spotify processes. Set to variable spotifyProcesses
				set spotifyProcesses to (count of (every process whose bundle identifier is "com.spotify.client"))
			end try
		end tell
		-- Check the variable spotifyProcesses, to see is Spotify running.
		if spotifyProcesses  0 then
			return true
		else
			return false
		end if
	end try
end isRunning

on isInLoginItems(appName)
	local allLoginItems
	try
		-- Get all apps in Login Items.
		tell application "System Events" to set allLoginItems to name of every login item as string
		-- Check if inputted app is in there.
		if appName is in allLoginItems then
			return true
		else
			return false
		end if
	end try
end isInLoginItems

on addToLoginItems(appName, appPath)
	local posixAppPath
	try
		-- Get the POSIX (Portable Operating System Interface) path of inputted appPath.
		set posixAppPath to POSIX path of alias appPath
		tell application "System Events"
			try
				-- Add inputted app to the Login Items.
				make login item at end with properties {path:posixAppPath, hidden:true}
			end try
		end tell
	end try
end addToLoginItems


Don't show bogus out-of-memory error when no artwork is available

FasdUAS 1.101.10
l!
O!
Z
@

n

1

pKnd

n

4

cArt
m
1

pTrk
m

L
n
1

pPCT
n
4

cArt
m
1

pTrk
	L
m

null
mnull
iTunes.app070 @)( Phookalis8ShireOH+
iTunes.appxͼG	 ApplicationsOShire:Applications:iTunes.app
iTunes.appShireApplications/iTunes.app/
.aevtoappnull****
.aevtoappnull****
k!

pTrk

cArt

pKnd

pPCT

null"*,k/,j*,k/,EYUascrޭ

FasdUAS 1.101.10
l
O
L
n

1

pPCT
	n

4

cArt
m
1

pTrk
m

null
iTunes.appP0@07h(.〿hookalisLMacintosh HDFwH+
iTunes.app@T	 ApplicationsF$Macintosh HD:Applications:iTunes.app
iTunes.appMacintosh HDApplications/iTunes.app/
.aevtoappnull****
.aevtoappnull****
k

pTrk

cArt

pPCT*,k/,EUascr
ޭ