• 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: Copying the path of files selected in Finder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying the path of files selected in Finder


  • Subject: Re: Copying the path of files selected in Finder
  • From: Yvan KOENIG <email@hidden>
  • Date: Sun, 30 Apr 2017 11:05:17 +0200

(1) In my sample script I used two syntaxes.
# 1st way
set aList to myLib's decoupe(theString, "vos")
log aList

# 2nd way
tell myLib
set theString to recolle(aList, "NOS")
end tell

The first one is OK when we use a single instruction calling the library.
The second is better when we use several calls to handlers of the library.

use myLib : script "fakeLib"
use scripting additions

set the_String to "Pour qui sont ces serpents qui sifflent sur vos têtes"
copy the_String to theString1
tell myLib
set theString1 to remplace(theString1, "serpents", "forts vents")
set theString1 to remplace(theString1, "sifflent", "soufflents")
set theString1 to remplace(theString1, "vos", "nos")
end tell

copy the_String to theString2
repeat with aCouple in {{"serpents", "forts vents"}, {"sifflent", "soufflent"}, {"vos", "nos"}}
set theString2 to myLib's remplace(theString2, aCouple's item 1, aCouple's item 2)
end repeat
{theString1, theString2}


(2) Before posting I carefully checked if my memory was right. To do that I tried to use:

use script "fakeLib"
use scripting additions

set theString to "Pour qui sont ces serpents qui sifflent sur vos têtes"

set aList to its decoupe(theString, "vos")
log aList

set theString to recolle(aList, "NOS")

It's simpler … but it fails issuing the message :
error "«script» ne comprend pas le message « decoupe »." number -1708 from «script»



Yvan KOENIG running Sierra 10.12.4 in French (VALLAURIS, France) dimanche 30 avril 2017 11:05:13



 _______________________________________________
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: 
 >Copying the path of files selected in Finder (From: Jean-Christophe Helary <email@hidden>)
 >Re: Copying the path of files selected in Finder (From: Yvan KOENIG <email@hidden>)
 >Re: Copying the path of files selected in Finder (From: Jean-Christophe Helary <email@hidden>)
 >Re: Copying the path of files selected in Finder (From: Yvan KOENIG <email@hidden>)
 >Re: Copying the path of files selected in Finder (From: Jean-Christophe Helary <email@hidden>)
 >Re: Copying the path of files selected in Finder (From: Yvan KOENIG <email@hidden>)
 >Re: Copying the path of files selected in Finder (From: Jean-Christophe Helary <email@hidden>)
 >Re: Copying the path of files selected in Finder (From: Christopher Stone <email@hidden>)
 >Re: Copying the path of files selected in Finder (From: Jean-Christophe Helary <email@hidden>)
 >Re: Copying the path of files selected in Finder (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: display as text anomaly
  • Next by Date: Re: Sorting characters of the text - script doesn't work as expected
  • Previous by thread: Re: Copying the path of files selected in Finder
  • Next by thread: Re: Copying the path of files selected in Finder
  • Index(es):
    • Date
    • Thread