• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Duplicate command syntax
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Duplicate command syntax


  • Subject: Re: Duplicate command syntax
  • From: Matthew Smith <email@hidden>
  • Date: Thu, 04 Jul 2002 12:59:21 +1000

on 04/07/2002 12:29, email@hidden at email@hidden wrote:

> I've got the Applescript manual right in front of me, but I must be missing
> something really obvious. Can anyone tell me what's wrong with this script?
>
> tell application "Finder"
> duplicate "Macintosh HD:file1.htm" to "Macintosh HD:file2.htm"
> end tell
>
> If I run it, I just get a "can't set Macintosh HD: file1.htm to Macintosh
> HD:file2.htm" error. I wish it would tell me why.


You are telling the Finder to duplicate a string to another string.
Shouldn't you be duplicating a file?

tell application "Finder"
set newFile to duplicate file "Macintosh HD:file1.htm" to folder
"Macintosh HD:"
set name of newFile to "file2.htm"
end tell
--
Matthew Smith
_______________________________________________
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.

References: 
 >Duplicate command syntax (From: email@hidden)

  • Prev by Date: Duplicate command syntax
  • Next by Date: Re: Duplicate command syntax
  • Previous by thread: Duplicate command syntax
  • Next by thread: Re: Duplicate command syntax
  • Index(es):
    • Date
    • Thread