xcode - POSIX file works in tell block -
the following works in script editor (or applescript app), not in xcode:
tell application "finder" set folder_list items of folder posix file "/users"
specifically, @ runtime:
finder got error: can’t make «class ocid» id «data optr000000002094230000600000» type integer. (error -1700)
if try "double coercion":
...((folder posix file "/users") posix file)
i get:
can’t make «class cfol» «script» of application "finder" type posix file. (error -1700)
i did see similar discussed here, solution did not work me: "posix file" works in applescript editor, not in xcode
thanks!
//reid
p.s. know use "macintosh hd:users"... works, unless renamed hard drive.
applescript has "path to" command find paths known folders, user's home folder, desktop, documents folder etc. that's best way access folders. can see locations applescript knows in standard additions applescript dictionary "path to" command. knows users folder is. such write code this...
set userspath path users folder tell application "finder" set folder_list items of userspath
Comments
Post a Comment