• 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: Simple apple script - Beginner Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple apple script - Beginner Problem


  • Subject: Re: Simple apple script - Beginner Problem
  • From: "Mark J. Reed" <email@hidden>
  • Date: Tue, 14 Jul 2009 10:23:46 -0400

On Tue, Jul 14, 2009 at 10:19 AM, Mark J. Reed<email@hidden> wrote:
> Or you could change them after the fact within AppleSscript using the
> old tried and true TID trick:
>
> set uncPath to (do shell script "/usr/bin/dscl localhost read " &
> (quoted form of dnPath) & "|awk -F: '{print substr($3,4)}' " )
> set text item delimiters to "\\"
> set componentList to text items of uncPath
> set text item delimiters to "/"
> set uncPath to componentList as text

And for grins you could do the whole thing without awk using the same trick:

set dsEntry to (do shell script "/usr/bin/dscl locahost read " &
(quoted form of dnPath)
set text item delimiters to ":"
set uncPath to text 4 through end of text item 3 of dsEntry
...
followed by the above.




--
Mark J. Reed <email@hidden>
 _______________________________________________
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: 
 >Simple apple script - Beginner Problem (From: James Bensley <email@hidden>)
 >Re: Simple apple script - Beginner Problem (From: James Bensley <email@hidden>)
 >Re: Simple apple script - Beginner Problem (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Simple apple script - Beginner Problem
  • Next by Date: Re: R1C1
  • Previous by thread: Re: Simple apple script - Beginner Problem
  • Next by thread: Re: Simple apple script - Beginner Problem
  • Index(es):
    • Date
    • Thread