Hi folks,
I'm 'porting' some of my Snow Leopard scripts to Lion using the AppleScript Editor and I'm having significant problems getting NSOpenPanel's openPanel() working. In my original script I used code along the lines of:
In Lion I got errors regarding the use of «class caCD», so I dug around a bit and ended up with:
While this compiles, I get 'NSOpenPanel doesnt understand the openPanel message' when I wrap it in an on run ... end run block and run it.
Could anyone enlighten me as to which stupid mistake I've made this time?
Thanks in advance...
I'm 'porting' some of my Snow Leopard scripts to Lion using the AppleScript Editor and I'm having significant problems getting NSOpenPanel's openPanel() working. In my original script I used code along the lines of:
Code:
tell application "Automator Runner" to tell «class opeP»
get it's properties
set floating to true
set «class caCD» to true
set «class alMT» to true
set «class titl» to "Select the items to Matroskify"
«event appScalM» "setShowsHiddenFiles:" given «class psof»:it, «class witP»:{false}
activate
if («event panSdisP» it) is not 0 then -- cancel button
--the path names property is a list of POSIX paths
set posixPaths to it's «class filO»
end if
end tell
In Lion I got errors regarding the use of «class caCD», so I dug around a bit and ended up with:
Code:
set myOpenPanel to current application's NSOpenPanel's openPanel()
myOpenPanel's setCanChooseFiles_(true)
myOpenPanel's setCanChooseDirectories_(true)
myOpenPanel's setAllowsMultipleSelection_(false)
myOpenPanel's runModal -- returns a list of file URL's
set posixPaths to myOpenPanel's URLs()
While this compiles, I get 'NSOpenPanel doesnt understand the openPanel message' when I wrap it in an on run ... end run block and run it.
Could anyone enlighten me as to which stupid mistake I've made this time?
Thanks in advance...