SuperCard Shell function
Execute shell commands
SuperCard Merge function
Variable & quote insertion.
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.
Shell Scripting reference at Apple
Page Information
|
Wiki Information |
Recent PBwiki Blog Posts |