gui scripting "hidden" application

Hello,

i am not sure where to put his as it does not deal with code.

Is it possible to make an app, that has been set to hidden with LSUIElement set to 1 in the info.plist, respond to gui scripting like clicking menu bar elements?

thanks,
elictricocean

bump - something like a just a hidden/or invisible dock icon?

No. It will respond to commands that don’t involve its GUI, but doesn’t have a GUI as you’re running it.

I’m not sure if this is what you’re asking, but I have the digital clock showing in my menu bar (i.e. the date and time preference). Here’s how you can go about gui scripting it. Try this script. You’ll probably have to change the variable menuBarItemNumber in the first line to make it work on your computer. Just try different numbers until you find the right number. Basically if you can see the menu bar items it can be gui scripted. I use this application to help me with gui scripting… http://prefabsoftware.com/uibrowser/

set menuBarItemNumber to 5

set tempVar to display dialog "View Date and Time as Analog or Digital Clock?" with icon note buttons {"Cancel", "Analog", "Digital"} default button "Digital"
set buttonEntered to the button returned of tempVar
activate application "SystemUIServer"
tell application "System Events"
	tell process "SystemUIServer"
		click menu bar item menuBarItemNumber of menu bar 1
		delay 0.5
		if buttonEntered is "Analog" then
			click menu item "View as Analog" of menu 1 of menu bar item menuBarItemNumber of menu bar 1
		else if buttonEntered is "Digital" then
			click menu item "View as Digital" of menu 1 of menu bar item menuBarItemNumber of menu bar 1
		end if
	end tell
end tell

i got it to work - key command still work