Re: Automator find and replace text string
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