Hi everybody ! I’m developing some scripts relying on the name of special files in a folder. All works fine except Finder replies very slowly when asked for some properties of files in a loop (name, original item and so on). I tried various things including using alias references instead of references, create a list of everything I need in one step, but with little success. Any clue ?
Thanks in advance !
Laurent Sebilleau.
: Hi everybody ! I’m developing some scripts relying on the
: name of special files in a folder. All works fine
: except Finder replies very slowly when asked for some
: properties of files in a loop (name, original item and
: so on). I tried various things including using alias
: references instead of references, create a list of
: everything I need in one step, but with little
: success. Any clue ?
For many of these properties, it’s faster to use ‘info for’ from the StandardAdditions. The result is a file information record, from which you can read various properties. For some things, though, you’ll still have to use the finder.
tell the application "Finder"
set theFiles to every file of thisFolder
end tell
repeat with thisFile in theFiles
set theInfo to info for thisFile
set {filename, modDate} to {name, modification date} of theInfo
if alias of theInfo is true then
tell the application "Finder"
set theOriginal to original item of thisFile
end tell
end if
end repeat
NG