Why do I get an error ‘file wasn’t found’ from:
on openFile(itsWindow)
tell open panel
set can choose directories to false
set can choose files to true
set allows multiple selection to false
end tell
set panelEnded to false
-- for file types {"xls"} applies for names with extensions
display open panel attached to window itsWindow
repeat until panelEnded
end repeat
set theFile to path names of the open panel
-- display dialog theFile as text
-- /Volumes/iMac Internal HD/Users/johnlove/Documents/
-- My Articles Folder/Medical/John Love (2009)
open theFile as alias
end openFile
My app works great when I drag-and-drop a file onto it. Doesn’t the “on open theFile” Handler see the dragged file as an alias?
Same error without “as alias” … I’ve even tried “set theFile to result of the open panel”