Re: Copy and Replacing
Re: Copy and Replacing
- Subject: Re: Copy and Replacing
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 04 Oct 2002 23:56:07 -0700
On 10/4/02 11:40 PM, "Richard Morton" <email@hidden> wrote:
>
On Saturday, October 5, 2002, at 03:15 AM, Paul Berkowitz wrote:
>
> On 10/4/02 9:44 AM, <email@hidden> wrote:
>
>
>
>> Whats the sytanx of the with replaicing statement
>
>
It's not (generally) 'with replacing', rather:
>
>
replacing yes/no/ask
>
>
Some apps/commands that use this also allow it as a boolean - just 'with
>
replacing' - but this is not a reliable way to use it unless it is
>
explicitly supported in the context in which it's being used:
>
>
store script < scriptObject > in file <fullPathString> with
>
replacing -- works for me, but is undocumented
>
>
store script <scriptObject> in file <fullPathString> replacing yes --
>
correct usage
>
>
>
>> ...I tried and it won't compile, giving and error that "A
>
>> Replacing:true can't go with folder"
>
>
>
> If your message subject is any indication, it looks as if your problem
>
> is
>
> not with the replacing parameter,
>
>
It is reasonably obvious that s/he was trying to use it as a boolean. I
>
wouldn't expect "Replacing:true" to compile anywhere, which is quite
>
probably what was typed by the look of the error message.
No, you are completely wrong, as a glance at the Finder dictionary will
demonstrate. I also thought it might be that, in light of the Standard
Additions you quote, but I checked the Finder Dictionary first:
duplicate: Duplicate one or more object(s)
duplicate reference -- the object(s) to duplicate
[to location reference] -- the new location for the object(s)
[replacing boolean] -- Specifies whether or not to replace items in
the destination that have the same name as items being duplicated
It's the same in both OS 9 and X.
The error was because of the incorrect use of 'copy' (which in the Finder
means 'copy to clipboard' although not functioning in X, and has no
'replacing' parameter of any description), instead of 'duplicate'.
>
>
>
> but with the command: if this is in the
>
> Finder (or any other app), you should be using 'duplicate' in the
>
> Standard
>
> Suite, not 'copy'. 'copy' is an AppleScript term for setting variables,
>
> not
>
> a Finder command for making duplicates of folders, files and other
>
> Finder
>
> items.
>
>
As has noted, it is in the Finder dictionary. There was also a time
>
(System 7.5 I think, not sure how long it lasted) when it would act like
>
'duplicate' under certain conditions. From memory, it would do so when
>
passed a Finder file ref, alias or FSS, but would otherwise behave in
>
the documented manner. Presumably done to help newbies.
>
It hasn't for quite some time, at least since OS 8.5 , probably since 8.1.
--
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.