• 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: Help duplicating file, desesperated
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help duplicating file, desesperated


  • Subject: Re: Help duplicating file, desesperated
  • From: Bill White <email@hidden>
  • Date: Wed, 05 May 2004 08:14:26 -0400

> -Getting the name of the disk
> set chav to (path to me) as string
> set vol to text item 1 of chav
>
> tell application "Finder"
> activate
> -- vol is "diskname"
> -- chemin is a string "folder:file.pdf"
> set theFileToDuplicate to vol & ":" & chemin
> -- How can I convert "theFileToDuplicate" to a string?, is this
> going wrong?
>
> set theFolderToRecieveFile to choose folder with prompt "Where don
> you want to write file?"
> duplicate theFileToDuplicate to theFolderToRecieveFile
> end tell
>
> I doesn't work
> I'm desesperated looking for the problem, what can I do?

Razi,

There are two small problems here. The first is that "text item 1 of chav"
is giving you just the first letter of the path name, not the whole volume
name. The other problem is theFileToDuplicate is just a string, and when you
go to duplicate it you need to refer to it as a "file."

Try the following:

set chav to (path to me) as string

set AppleScript's text item delimiters to ":"

set vol to text item 1 of chav

set AppleScript's text item delimiters to ""

tell application "Finder" -- "activate" isn't needed here

set theFileToDuplicate to vol & ":" & chemin

set theFolderToRecieveFile to choose folder with prompt "Where do you
want to write file?"

duplicate file theFileToDuplicate to theFolderToRecieveFile

end tell

Hope that helps.

Bill
_______________________________________________
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.


  • Follow-Ups:
    • Re: Help duplicating file, desesperated
      • From: Michelle Steiner <email@hidden>
References: 
 >Help duplicating file, desesperated (From: "Raul Anfibic" <email@hidden>)

  • Prev by Date: Help duplicating file, desesperated
  • Next by Date: Open files, do Photoshop action
  • Previous by thread: Help duplicating file, desesperated
  • Next by thread: Re: Help duplicating file, desesperated
  • Index(es):
    • Date
    • Thread