Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An AppleScript to open the Show Recent menu' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to open the Show Recent menu
Authored by: ehouwink on Jun 26, '06 01:26:44PM

Pfff, in TextEdit, the lists created with the previous script appear to contain mini-icons that get translated as question marks, so I had to filter that out:

[code]
tell application "TextEdit" to activate

tell application "System Events"
set strAppName to name of some application process whose frontmost is true
tell process strAppName
tell menu bar 1
if (strAppName is "Finder") then
if (exists menu item "Recent Folders" of menu "Go") then
click menu "Go"
click menu item "Recent Folders" of menu "Go"
end if
else
set recentmenu to (every menu item of menu "File" whose name contains "Recent")
if recentmenu = {} then return
set recentmenu to item 1 of recentmenu
tell me to set rr to name of menu items of menu 1 of recentmenu
beep
end if
end tell
end tell
end tell

tell application "System Events" to ¬
set fApp to some application process whose frontmost is true
tell fApp
activate
set theItem to choose from list rr
end tell
if theItem is false then return
set theItem to theItem as string

-- filteren van "?" uit TextEdit's mini-icons in dialoog
if character 1 of theItem contains "?" then set theName to text from character 2 to -1 of theItem

set theItem to theName as string

using terms from application "System Events"
tell application "System Events" to set frontmost of process strAppName to true
set rr to every menu item of menu 1 of recentmenu whose name contains theItem
if rr ≠ {} then click item 1 of rr
return theItem
end using terms from
[/code]



[ Reply to This | # ]