• 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: File Duplication Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File Duplication Question


  • Subject: Re: File Duplication Question
  • From: Axel Luttgens <email@hidden>
  • Date: Wed, 13 Jan 2010 00:42:51 +0100

Le 12 janv. 2010 à 21:19:02, Oakley Masten a écrit :

> Hi All
> Got a question that I just can't find a simple answer to.
>
> I want to duplicate files from a local folder to another folder on a server
>
> I will then move the file into a subfolder called "Processed" on the local machine.
> Doing this is easy - so here is the question.
>
> How do I change the name of the duplicated file on the server at the time of duplication.
>
> I would think that"
>
> Tell application "finder"
>     set theFile to choose file
>     duplicate theFile to Destination folder path on server with properties {name:"NewNameForFile.txt"}
> end tell
>
> But it doesn't.

Hello Oakley,

The Finder's dictionary doesn't show a "with properties..." parameter for the duplicate command. The failure of your attempt thus isn't that surprising... ;-)


> I could duplicate the file to the destination folder
> then reference the original file name at the destination path and rename it.
>
> Extra steps and not very elegant coding.
>
> Any clues as to what I am doing wrong here?

One way to mimic the missing "with properties..." parameter could be:

	tell application "Finder"
		set SourceFolder to folder "a1" of desktop
		set DestFolder to folder "a2" of desktop
		set name of (duplicate file "somefile1" of SourceFolder to DestFolder) to "somefile2"
	end tell

HTH,
Axel


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

This email sent to email@hidden

References: 
 >File Duplication Question (From: Oakley Masten <email@hidden>)

  • Prev by Date: Re: File Duplication Question
  • Next by Date: trigger a sync in itunes to apple tv
  • Previous by thread: Re: File Duplication Question
  • Next by thread: Re: File Duplication Question
  • Index(es):
    • Date
    • Thread