• 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: Making a List out of Terminal "ls" command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making a List out of Terminal "ls" command


  • Subject: Re: Making a List out of Terminal "ls" command
  • From: Christopher Nebel <email@hidden>
  • Date: Fri, 11 Feb 2005 12:33:40 -0800

On Feb 10, 2005, at 2:58 PM, Doug McNutt wrote:

Terminal.app has a -s switch in which you can specify s meaning "Return results as AppleScript entities" or something like that.

osascript -s s << END
tell application "Terminal"
   get bounds of front window
end tell
END

will return an AppleScript list something like {123, 456, 789, 912}

Perhaps such a call would work with ls. But I donno how to specify -s in a "do shell script" from the Script Editor.

First, you mean osascript(1), not Terminal. Second, that's not what -s s does -- read the man page. By default, osascript prints its results in "human-readable" form, i.e., no quotes around strings, no backslashing, no braces around lists, and so on. Adding "-s s" means "print in 'source' form", which is the same thing you see in Script Editor's result window. This is potentially useful for several things, but has very little to do with how results are returned from 'do shell script "ls"'.



--Chris Nebel AppleScript Engineering _______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Making a List out of Terminal "ls" command (From: Christopher MJ Tangora <email@hidden>)
 >Re: Making a List out of Terminal "ls" command (From: Doug McNutt <email@hidden>)

  • Prev by Date: Re: QUOTED posix to HFS path
  • Next by Date: Match CMYK doesn't work.
  • Previous by thread: Re: Making a List out of Terminal "ls" command
  • Next by thread: Scripting Inkpad
  • Index(es):
    • Date
    • Thread