RE: Finder scripting: OS 9 vs OS X
RE: Finder scripting: OS 9 vs OS X
- Subject: RE: Finder scripting: OS 9 vs OS X
- From: "Fox, Christopher B" <email@hidden>
- Date: Thu, 15 Aug 2002 16:35:39 -0400
Paul:
Can you try your recommendation on a share mounted from an ASIP
6.3.3 server? I can get these recommendations to work fine on local disks,
but they all fail with the same errors on disks mounted from an ASIP server.
Here is some sample code:
mount volume "afp://asipserver/diskname" as user name "blah" with password
"blah"
tell application "Finder"
set theFiles to every file of disk "diskname"
repeat with aFile in theFiles
set aFile to aFile as alias
set modDate to modification date of (info for aFile)
return modDate
end repeat
end tell
This fails with a descriptor type error on the attempted coersion to alias.
If, however, you try this with a local disk, the coersion works fine.
Christopher Fox
Senior Support Technician
Solicitations IT
Capital One
cel: 804-301-4117
tel: 804-967-1553
fax: 804-968-2052
>
----------
>
From: Paul Berkowitz
>
Sent: Thursday, August 15, 2002 12:46 PM
>
To: Applescript-Users
>
Subject: Re: Finder scripting: OS 9 vs OS X
>
>
On 8/15/02 8:46 AM, "Fox, Christopher B" <email@hidden>
>
wrote:
>
>
> Why does the following script work fine in Mac OS 9.2.2 (AS 1.8.3), but
>
fail
>
> in Mac OS X 10.1.5?
>
>
>
> tell application "Finder"
>
> set theFiles to every file of (choose folder)
>
> repeat with aFile in theFiles
>
> set fileInfo to info for aFile
>
> end repeat
>
> end tell
>
>
>
> Mac OS X 10.1.5 complains, "Finder got an error: File document file
>
<file
>
> name> wasn't found."
>
>
>
If you look in Standard Additions, you'll see that the argument for 'info
>
for' is "anything -- the alias or file reference to the file or folder".
>
But you're using the Finder's 'file' reference, which is a different
>
kettle
>
of fish. And in OS X, it seems to be confused - it considers almost every
>
file to be this 'document file' thing. In OS 9, the Finder file probably
>
coerced naturally to the AppleScript 'alias' format needed by 'info for'.
>
or
>
else maybe you have Jon's Commands or Akua Sweets installed, which will do
>
it for you. In OS X you should spell it out, outside the Finder:
>
>
>
tell application "Finder"
>
set theFiles to every file of (choose folder)
>
end tell
>
>
repeat with aFile in theFiles
>
set fileInfo to info for (aFile as alias)
>
end repeat
>
>
>
Actually, it works fine inside the Finder tell lock too, if you really
>
need
>
it to (why?):
>
>
tell application "Finder"
>
set theFiles to every file of (choose folder)
>
>
repeat with aFile in theFiles
>
set fileInfo to info for (aFile as alias)
>
end repeat
>
end tell
>
>
>
--
>
Paul Berkowitz
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
>
>
**************************************************************************
The information transmitted herewith is sensitive information intended only
for use by the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.