0
목록에서 선택 대화 상자를 통해 '최근 항목'하위 메뉴에서 선택한 항목을 열려면이 AppleScript를 작성했습니다. 첫 번째 항목에 대해 작동 한 다음 정상적으로 종료하고 다른 항목을 열지 않습니다.최근 문서 하위 메뉴 열기
아래에서 볼 수있는대로 '표시 대화 상자'를 추가하여 제대로 작동하는지 아이디어를 얻을 수 있습니다. 아직도, 그것은 ...하지 않는
tell application "Finder"
activate
try
tell application "System Events"
tell process "Finder"
tell menu "Recent Items" of menu item "Recent Items" of menu 1 of menu bar 1
set menuItemNames to (get name of (every menu item whose position ≠ missing value and name ≠ "Applications" and name ≠ "Documents" and name ≠ "Servers" and name ≠ missing value))
set text item delimiters of AppleScript to ","
set targetMenuItems to (choose from list menuItemNames with prompt "Choose a recent document to view:" with title "Recent Documents" OK button name "Open" with multiple selections allowed) as list
set targetMenuItems to (text items of targetMenuItems as text)
if targetMenuItems ≠ "false" then
set menuitemCount to (count text items in targetMenuItems)
display dialog menuitemCount
display dialog (text item 1 of targetMenuItems)
set x to 1
repeat menuitemCount times
set targetItem to (text item x of targetMenuItems)
display dialog targetItem
click menu item targetItem
set x to x + 1
end repeat
end if
end tell
end tell
end tell
on error errorMsg
display dialog errorMsg
end try
end tell
이 완벽하게 작동하는 것 같다 당신이 '말하기 응용 프로그램'Finder '를'활성화 '에 추가하는 한 처음에. 도와 줘서 고마워! – AppleScripter