• 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: MS-DOS better than Applescript??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MS-DOS better than Applescript??


  • Subject: Re: MS-DOS better than Applescript??
  • From: Paul Berkowitz <email@hidden>
  • Date: Tue, 03 Sep 2002 13:03:13 -0700

On 9/3/02 12:34 PM, "Roman Fischer" <email@hidden> wrote:

> I want to do a simple thing: copy a file into the same folder using an other
> name. In (good?) old MS-DOS days this was a simple thing:
>
> Copy c:\abc\def.txt c:\abc\ghi.txt
>
> Call me stupid but I did not find a solution to do this in Applescript
> (MacOS X 10.1.5). After spending a few evenings in searching for a solution
> I still did not find one.
>
> How can I do such a copy in Applescript (or is MS-DOS really better;-) ?
>

1) Take a good look at the Finder dictionary, Standard Suite.

tell app "Finder"
set theFile to file "Mac Hard Disk:Folder 1:Folder 2:File Name"
set dupFile to duplicate theFile
set dupFile to dupFile as alias -- can still find it when name changes
set name of dupFile to "New Name"
update dupFile
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.

References: 
 >MS-DOS better than Applescript?? (From: Roman Fischer <email@hidden>)

  • Prev by Date: Re: MS-DOS better than Applescript??
  • Next by Date: Re: MS-DOS better than Applescript??
  • Previous by thread: Re: MS-DOS better than Applescript??
  • Next by thread: Re: MS-DOS better than Applescript??
  • Index(es):
    • Date
    • Thread