• 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: Is this possible in apple script? sed -e 's;\(.*/\).*;\1; | sed 's//share/HDA_DATA//Volumes/g'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is this possible in apple script? sed -e 's;\(.*/\).*;\1; | sed 's//share/HDA_DATA//Volumes/g'


  • Subject: Re: Is this possible in apple script? sed -e 's;\(.*/\).*;\1; | sed 's//share/HDA_DATA//Volumes/g'
  • From: Vincent <email@hidden>
  • Date: Thu, 19 Dec 2013 00:03:44 +0400

instead of sed and with some documentation I came up with this
surely can be simplified:

/share/HDA_DATA/Travaux/PAO/PAO_ENCOURS/Travaux/127266/Jpg/Jpg/Logo.jpg


set AppleScript's text item delimiters to "/"
set PathToItem to the clipboard as string
set all to count word of PathToItem
set essai to all - 1
set Dest to text items 1 thru all of PathToItem
set the clipboard to result as string
set NextStep to the clipboard as string
set AppleScript's text item delimiters to "/"
set all2 to count word of NextStep
set almostThere to words 3 thru all2 of NextStep
set hereItIs to "/Volumes/" & almostThere
do shell script "open " & hereItIs & ""





many thx

On Dec 18, 2013, at 4:25 PM, email@hidden wrote:

Is this possible in apple script? sed -e 's;\(.*/\).*;\1; |
     sed 's//share/HDA_DATA//Volumes/g'

 _______________________________________________
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: Is this possible in apple script? sed -e 's;\(.*/\).*;\1; | sed 's//share/HDA_DATA//Volumes/g'
      • From: Thomas Fischer <email@hidden>
  • Prev by Date: Re: Changes in 10.8
  • Next by Date: Yuletide greets (Was: Re: Changes in 10.8)
  • Previous by thread: Is this possible in apple script? sed -e 's;\(.*/\).*;\1; | sed 's//share/HDA_DATA//Volumes/g'
  • Next by thread: Re: Is this possible in apple script? sed -e 's;\(.*/\).*;\1; | sed 's//share/HDA_DATA//Volumes/g'
  • Index(es):
    • Date
    • Thread