• 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
Why is copying a file so hard?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why is copying a file so hard?


  • Subject: Why is copying a file so hard?
  • From: email@hidden
  • Date: Sat, 18 Jun 2005 09:18:10 +1000

I'm with Sparky (well at least philosophically).
I want to copy a few files from mounted volumes on my desktop to a specified folder on my local HD.
I thought just open Script Editor and set it to record, drag the files where I want them and it will create the necessary Applescript (I'm fairlycertain this worked in OS 9).
Wrong! - nothing happens!


So I go through this list archives (I've subscribed for years and find it helpful to search historic emails when I can't find the right Applescript code - unfortunately more often than not) and find a note from January where some one suggests using Do script and the cp command in the shell.

I copy the line of code and try it in Script Editor which promptly complains because the filename contains a space which I believe I've correctly escaped with a \
So I go to Terminal put in the cp, drag the source and destination files to the command line so Terminal now builds a syntactically correct string. I test it by hitting return and the file copies correctly.
So I copy this string back to Script Editor (put the " in at each end) and once again it complains. 'Expected """ but found unknown token' with a highlight on the first \.
Grrr.
If it's any help the line is
do shell script "cp /Volumes/1GIG/\ SPELEAN/\ Spelean\ data /Volumes/Lt\ Data/v3.9\ DF/\ Spelean\ data.AP"
The folder SPELEAN has a leading space, as does the file, as does the destination volume, folder and file.


OK I mutter to myself about why Apple can't make basic functions in the Finder recordable and I open the Dictionary for Finder.app and find there isn't a copy command - it isn't available yet says the note (for goodness sake this is OS X 10.4.1 the fifth version of OS X and we can't copy to the clipboard using Applescript!), but there is a duplicate command.
so I try
duplicate "/Volumes/1GIG/ SPELEAN/ Spelean data" to "/Volumes/Lt Data/v3.9 DF/ Spelean data.AP" replacing Yes
This time I get 'An identifier can't go after this """ '.
Yet the syntax in the dictionary says I can have "Replacing boolean" as part of the command. AAAArrrgghh.


This is a simple task and it should be simple in Applescript but it isn't and the syntax checking is perhaps accurate, but ultimately unhelpful.

And why is the Finder still not fully recordable?
and finally can anyone suggest a line which will work?
Cheers, Andrew Pavey
--

Spelean is the exclusive Australian and New Zealand Distributor
for many fine camping, climbing, caving and rescue  products

Web pages: http://www.spelean.com.au    email: email@hidden

Phone: (+61) 2 9966 9800, Fax: (+61) 2 9966 9811
PO Box 645, ARTARMON, NSW, 1570, Australia.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Why is copying a file so hard?
      • From: tim <email@hidden>
    • Re: Why is copying a file so hard?
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: One for the experts: Serial Number of computer using Applescript Studio
  • Next by Date: Re: One for the experts: Serial Number of computer using Applescript Studio
  • Previous by thread: Re: Applescript-users Digest, Vol 2, Issue 403
  • Next by thread: Re: Why is copying a file so hard?
  • Index(es):
    • Date
    • Thread