• 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: Rewrite simple Finder tell statement to "do shell script"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rewrite simple Finder tell statement to "do shell script"


  • Subject: Re: Rewrite simple Finder tell statement to "do shell script"
  • From: Axel Luttgens <email@hidden>
  • Date: Tue, 11 Sep 2012 14:43:40 +0200

Le 11 sept. 2012 à 11:43, Bert Groeneveld a écrit :

> tell application "Finder"
> 	move all_foundImageNames to the_CLEANSTART_folder
> end tell
>
> Hi, can someone help to rewrite above simple Finder tell statement with "do shell script"?
>
> The statement is inside a repeat loop and the variable all_foundImageNames changes through each loop, but is is always a list of 1 or more full paths, for example: {"Macintosh_HD:Applescript:Hoogvliet:Hoogvliet POS Subomgeving:HiRes_Images:10055 Knorr vissaus.jpg"}. The variable the_CLEANSTART_folder is always the same.
>
> Background info: My script already runs fine with the Finder statement, but very, very, very slow, because of talking to a folder in the Finder containing many thousands of files (at least, that is my opinion). I was thinking that replacing the Finder statement with a "do shell script" thing might speed up the sript.
>
> And I don't know how to write that.

Hello Bert,

Assuming all_foundImageNames is a list of HFS paths and the_CLEANSTART_folder is an HFS path as well (all those paths pointing to existing items), you may do it outside the Finder; for example:

	set Sources to ""
	repeat with src in all_foundImageNames
		set Sources to Sources & quoted form of POSIX path of (alias src) & " "
	end repeat
	set Destination to quoted form of POSIX path of (alias the_CLEANSTART_folder)
	do shell script "/bin/mv " & Sources & Destination

Now, part of your speed problem may come from possibly unneeded conversions (file references to textual paths to file references...). Could yo tell us how you build the values for all_foundImageNames and the_CLEANSTART_folder?

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: 
 >Rewrite simple Finder tell statement to "do shell script" (From: Bert Groeneveld <email@hidden>)

  • Prev by Date: Re: Rewrite simple Finder tell statement to "do shell script"
  • Next by Date: Re: Rewrite simple Finder tell statement to "do shell script"
  • Previous by thread: Re: Rewrite simple Finder tell statement to "do shell script"
  • Next by thread: Re: Rewrite simple Finder tell statement to "do shell script"
  • Index(es):
    • Date
    • Thread