• 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: CGIs with OSX
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGIs with OSX


  • Subject: Re: CGIs with OSX
  • From: Christopher Nebel <email@hidden>
  • Date: Mon, 2 Apr 2001 11:32:47 -0700

On Monday, April 2, 2001, at 12:41 AM, T&B wrote:

AFAIK the command "osascript" works with files, not strings.

No, osascript does both :-) The man page doesn't make it clear:

"DESCRIPTION
osascript executes the given script file, or standard input if none is
given."

but it does work. To prove it, try this via Telnet:

/usr/bin/osascript '2+3'

which compiles on the fly and gives the result of 5.

Since you can give it strings, it compiles on the fly and can include variables for dynamic output.

Once again, this "feature" will go away in the next version. It never should have shipped in the first place, but we had bigger fish to fry, and quite frankly I didn't think people would discover it so quickly!

To get the same effect using sanctioned channels, use echo or cat to pipe to osascript, like this:

% echo "2+3" | /usr/bin/osascript
5


--Chris Nebel
AppleScript Engineering


References: 
 >Re: CGIs with OSX (From: T&B <email@hidden>)

  • Prev by Date: Folder actions in OSX ?
  • Next by Date: Re: (no subject)
  • Previous by thread: Re: CGIs with OSX
  • Next by thread: Re: CGIs with OSX
  • Index(es):
    • Date
    • Thread