Transmission Blocklist

Hello, i’ve got a tiny problem here…

I made this to update the blocklist in Transmission, and would like to hide the settings view and then Transmission again after an update
but when running the script as listed below, I get “boing” sound as it trys to close the window right after the script has been activated
is there anyway to check if the update process it running, and wait until it’s done?, I’ve tryed moving the “if hidePreff then keystroke” part
up/down, but nomater what ever i do it just keeps giving me that boing boing sound :smiley:


on updateBlockList(hidePreff)
	set updateButton to "Update"
	tell application "Transmission" to activate
	tell application "System Events"
		if UI elements enabled then
			tell application process "Transmission"
				keystroke "," using command down
				delay 0.2
				
				tell window 1
					tell button "Peers" of tool bar 1 to click
					tell button updateButton
						click
					end tell
					
					if hidePreff then keystroke "w" using command down
				end tell
				
			end tell
		end if
	end tell
end updateBlockList

updateBlockList(true)


/mkh

Ouch! been searching the forum like crazy for like 2 hours, can it really be that hard to do this :confused:

bump?

:confused: