SuperCard Shell Essentials



Extending SuperCard with OS X Shell Commands

SideBar

Essential SuperCard functions

SuperCard Shell function
Execute shell commands
SuperCard Merge function
Variable & quote insertion.


A Quick look

OS X ships chock full of preinstalled shell commands capable of a wide variety of tasks.
Some are single purpose utilities akin to the Xfcns/Xcmds we're all accustomed to.

The screencapure command captures the screen, window, or any portion thereof, to clipboard (or file) returning nothing.

Capture portion of screen (interactive, to clipboard)
on mouseup
  put shell("screencapture -ic ;") into junk
end mouseup

Others are powerful languages with hundreds of individual commands and functions.
Fortunately, one needn't learn all of such languages to take advantage.

The example below uses a Perl function to tidy-up output.

Return GMT formatted to HTTP specification
function gmtime
  return shell("date -u +'%a, %e %b %Y %T %Z' | perl -pe chomp ;")
end gmtime

A linefeed is usually appended to text output, which in-turn is converted automatically to a carriage return by the SuperCard shell function (unless the extended function syntax is used)
The Perl function 'chomp' deletes linefeeds from output.


Recent Additions

Directory & File Lists


Reference

Shell Scripting reference at Apple


Top


Page Information

  • 2 years ago [history]
  • View page source
  • You're not logged in
  • Recent comments:
    DCS:No worries!
    John Johnston:No I just clicked on a link t o sidebarin todays tips and it seemed to make a page, eek!
    DCS:Looks like you may have been toying with a sidebar a bit earlier. I've delayed to make sure i don't trash something you may have started.
  • No tags yet learn more

Wiki Information

Recent PBwiki Blog Posts