Re: What is wrong with my script
Re: What is wrong with my script
- Subject: Re: What is wrong with my script
- From: Emmanuel LEVY <email@hidden>
- Date: Fri, 11 Sep 2009 23:35:10 +0200
You already got answers, mine would be a bit different since:
1. I need POSIX paths (AppleScript's alias is not reliable when it
comes to the items in /Network or /Volumes),
2. I need speed, and Finder is speed's enemy.
What I do is use a Scripting Addition (osax) instead of Finder:
set thePath to "/Applications"
modification date of (info for posix file thePath)
(Note that this is not handy for a big folder, since "info for" will
compute the folder's size.)
In my experience, store and handle only posix paths, and whatever
command requires a "posix file", just prefix the posix path with
"POSIX file": that's not really like making a new object (like you do
with AS_path), it's more like telling the command how to understand
the string you're passing.
Emmanuel
On Sep 11, 2009, at 8:53 PM, xorx wrote:
Running the following script in AppleScript editor creates error
-1728:
--start
set AS_path to POSIX file "/Applications/"
tell application "Finder"
set dat to modification date of AS_path
end tell
--end
It says that "modification date of file "/Applications/"" could not
be read. This error happens with all possible properties of file
objects. The file obviously exists and I have no clue why this does
not work...
Thanks for any help,
Georg
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden