• 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: Automator find and replace text string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automator find and replace text string


  • Subject: Re: Automator find and replace text string
  • From: Shane Stanley <email@hidden>
  • Date: Sun, 17 Jun 2018 22:34:46 +1000

On 17 Jun 2018, at 10:23 pm, Jean-Christophe Helary <email@hidden>
wrote:
>
> I don't think I'd use AS for that. I'd use [Run shell script] and do a sed
> replace on the string you get.

Seems like a bit of overkill for a simple literal replace.

tell application "Finder" to set finderSelectionList to selection as alias list
if length of finderSelectionList = 0 then error "No files were selected in the
Finder!"
set thePath to POSIX path of item 1 of finderSelectionList
set saveTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"/"}
set thePath to text items of thePath
set AppleScript's text item delimiters to {" ➤ "}
set thePath to thePath as text
set AppleScript's text item delimiters to saveTID
set the clipboard to thePath

--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>


 _______________________________________________
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

  • Follow-Ups:
    • Re: [applescript] Automator find and replace text string
      • From: Alastair Leith <email@hidden>
References: 
 >Automator find and replace text string (From: Alastair Leith <email@hidden>)
 >Re: Automator find and replace text string (From: Jean-Christophe Helary <email@hidden>)

  • Prev by Date: Re: Automator find and replace text string
  • Next by Date: Re: Automator find and replace text string
  • Previous by thread: Re: Automator find and replace text string
  • Next by thread: Re: [applescript] Automator find and replace text string
  • Index(es):
    • Date
    • Thread