Re: Desktop question
Re: Desktop question
- Subject: Re: Desktop question
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 23 Jan 2001 14:37:29 -0500
on 1/23/01 1:54 PM, Marc K. Myers at email@hidden wrote:
>
The script I'm trying to write is a droplet, so the file reference
>
coming in is an alias, which ought to include the volume information.
Yes. It helps when you explain the execution context.
>
Then I tell "Finder" to rename the copy:
>
>
set name of file "UnderConstr Catlg copy" of folder "Desktop Folder" of
>
disk "Communications" to "UnderConstr Catlg [NR]"
>
>
But this returns an error:
>
>
--> Finder got an error: Can't set folder "Desktop Folder" of disk
>
"Communications" to "UnderConstr Catlg [NR]".
This appears to be a bug in Finder 9.1.
I duplicated your experience by doing the following:
1. Use Disk Copy to create a new HFS disk on my desktop called "MyDisk"
(this is a convenient way to test non-startup disks when you don't have a
real non-startup disk handy).
2. Create a clipping file in the new disk named "Temp".
3. Run this script:
tell application "Finder"
set name of file "Temp" of folder "Desktop Folder" of disk "MyDisk" to
"Perm"
end tell
It yields the same error message you got (with the different names).
The Mac OS 9.1 Technote indicates that the Finder was fixed so it now always
determines the volume on which a desktop folder resides on the fly (as I
understand it), rather than making assumptions. The bug you have discovered
(and older bugs relating to the Desktop Folder that persist in the Finder's
AppleScript implementation) suggest to me that Finder scripting might not
have caught up with this change to the Finder's inner mechanisms.
I have already noted that various AppleScript constructs report that files
dragged to the desktop from non-startup disks still report that they reside
on the startup disk.
However, it isn't necessary to specify that the disk is in a Desktop Folder
folder. This script works:
tell application "Finder"
set name of file "Temp" of disk "MyDisk" to "Perm"
end tell
-
Bill Cheeseman, Quechee, Vermont <
mailto:email@hidden>
The AppleScript Sourcebook
<
http://www.AppleScriptSourcebook.com/>
Vermont Recipes-A Cocoa Cookbook
<
http://www.stepwise.com/Articles/VermontRecipes/>