The snippet you posted uses relative paths. Last I checked AppleScript doesn’t guarantee the current working directory when it runs a script, so it’s best to deal with absolute paths. If you want to get well-known locations, use
When passing paths to AppleScript’s
do shell script, it’s important to use
quoted form of.
To put these two together, here’s how to call
staton an arbitrary item on the desktop.
set itemName to … set desktopPath to POSIX path of (path to desktop) set itemPath to desktopPath & itemName do shell script "stat " & quoted form of itemPath
ps Technote 2065 do shell script in AppleScript has a bunch of useful hints in this space.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"