Re: Can menu extra applications be scripted?
Re: Can menu extra applications be scripted?
- Subject: Re: Can menu extra applications be scripted?
- From: KOENIG Yvan <email@hidden>
- Date: Fri, 13 Feb 2009 09:30:27 +0100
Le 13 févr. 2009 à 00:23:51, Sean DeNigris a écrit :
Hey everyone:
I never got an answer and I've tried everything I can think of.
Does anyone have an idea how to script an app (Fastscripts) that
appears as a menu extra? The dictionary has not been implemented
correctly, so I was trying to use GUI scripting, but I can't get
the app to respond. Please help!!!!!!!!
Here is an old beast written to swap keyboard setting.
Maybe it will be able to put you on the track .
{code}
tell application "System Events" to tell process "SystemUIServer"
set _ to get value of attribute "AXDescription" of every menu bar
item of menu bar 1
set {k, j} to {count of _, 0}
repeat with i from 1 to k
if _'s item i is "text input menu extra" then
set j to i
exit repeat
end if
end repeat
if j > 0 then
tell menu bar item j of menu bar 1
click
tell menu 1
set {lk, kl, i} to {get name of every menu item, {}, 0}
repeat
set i to i + 1
if lk's item i is missing value then exit repeat
set end of kl to lk's item i
end repeat
(* now we have a list of installed layouts *)
set knt to count of kl
if knt > 1 then
repeat with i from 1 to knt
if (value of attribute "AXMenuItemMarkChar" of menu item (kl's
item i) is not "") then
if i = knt then
set i to 1 (* back to top of list *)
else
set i to i + 1 (* switch to next layout *)
end if
exit repeat
end if
end repeat
click menu item (kl's item i)
end if -- knt > 1
end tell -- to menu 1
end tell -- to menu bar item…
end if -- j > 0
end tell -- to process and System Events
{code}
Yvan KOENIG (from FRANCE vendredi 13 février 2009 09:29:09)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden