use framework "Foundation" use AppleScript version "2.4" use scripting additions property NSThread : class "NSThread" property NSOpenPanel : class "NSOpenPanel" if not (current application's NSThread's isMainThread()) as boolean then display alert "This script must be run from the main thread using ^รข +R." buttons {"Cancel"} as critical error number -128 end if set op to NSOpenPanel's openPanel() tell op its setMessage:"Flying on your Desktop" its setFloatingPanel:true -- floats on top of all other windows its setAllowedFileTypes:["com.adobe.pdf"] end tell if (op's runModal() = (current application's NSFileHandlingPanelOKButton)) then display dialog (op's URLs()) as text end if return