Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Failure to duplicate file



On Jan 31, 2008, at 12:08 PM, Jim Skibbie wrote:

Is it me or is the Finder really flaky under Applescript? I don’t understand this Applescript stuff some days...

This seems to work sometimes and sometimes it doesn’t:

tell application “Finder”
set backedupFile to duplicate existingFile to folder backupFolder with replacing
end tell


Where existingFile and backupFolder are variables of class alias that point to an afp mounted volume.

Sometimes this command works, sometimes I get an error that says “Get failed: no such object (e.g. Specifier asked for the 3rd, but there are only 2)(errAENoSuchObject-1728)”

Any suggestions?

The Finder dictionary says ... duplicate v : Duplicate one or more object(s) duplicate reference : the object(s) to duplicate [to location reference] : the new location for the object(s)

It wants references, not aliases. 'folder backupFolder' is a reference, but 'existingFile' is not.
Try this ...
set backedupFile to duplicate item existingFile to folder backupFolder with replacing


_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Failure to duplicate file (From: Jim Skibbie <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.