jujutool
intro • commands • escapes • contact
modified:  Monday, September 24, 2007


Escape Sequences

For many jujuTool commands which use text, special escape sequences can be used. These sequences are always indicated with a dollar sign. Some examples of their usage:

dialog text My IP is $[ip]

opens a simple dialog with text "My IP is 192.168.0.3"

To see a dialog like the one on the right, we can use the following:

dialog text $[time] - $[date]$nIP Address: $[ip]$nUser: $[user]$nHost: $[host]$nDisk Space: $[disk drive c free " / " total]MB

Escape sequences and parameters

$$
the dollar sign, to avoid text being misinterpreted as symbolic values
Examples:
"using $$[ip] results in $[ip]" -> "using $[ip] results in 192.168.0.3"
$n
a line feed (or newline) character
$t
a tab character
$[ip -switch hostname]
host's (first) ip address. If hostname is omitted then local machine is assumed.
Switches: (preceded by a dash)
first - show only first IP (default)
last - show only last IP
all - show ALL IP Addresses, separated by new lines
Examples:
$[ip] -> "192.168.0.3"
$[ip microsoft.com] -> "207.46.197.100"
$[ip -all microsoft.com] ->
207.46.197.100
207.46.197.102
207.46.230.218
207.46.230.219
207.46.230.220
$[ip -last microsoft.com] -> "207.46.197.220"
$[host]
name of local machine
Examples:
$[host] -> "Boffo"
$[user]
current user name
Examples:
$[user] -> "Administrator"
$[os ...]
Data relating to current OS. Supported values:
major - Major version number
minor - Minor version number
build - build number
platform - "Windows" or "Windows NT"
extra - service pack or other extra info
Examples:
$[os major "." minor "." build ] -> "5.0.2195"
$[os platform " " extra] -> "Windows NT, Service Pack 3"
$[time format]
with no arguments returns local time in 24 hour format. With format you have lots more control. (Uses C function strftime... list below is taken from C documentation)
Examples:
$[time] -> "15:51" (same as $[time "%H:%M"]
$[time "%A"] -> "Wednesday"
Available arguments:
%a=Abbreviated weekday name / %A=Full weekday name / %b=Abbreviated month name / %B=Full month name / %c=Date and time representation appropriate for locale / %d=Day of month as decimal number (01 – 31) / %H=Hour in 24-hour format (00 – 23) / %I=Hour in 12-hour format (01 – 12) / %j=Day of year as decimal number (001 – 366) / %m=Month as decimal number (01 – 12) / %M=Minute as decimal number (00 – 59) / %p=Current locale’s A.M./P.M. indicator for 12-hour clock / %S=Second as decimal number (00 – 59) / %U=Week of year as decimal number, with Sunday as first day of week (00 – 53) / %w=Weekday as decimal number (0 – 6; Sunday is 0) / %W=Week of year as decimal number, with Monday as first day of week (00 – 53) / %x=Date representation for current locale / %X=Time representation for current locale / %y=Year without century, as decimal number (00 – 99) / %Y=Year with century, as decimal number / %z, %Z=Time-zone name or abbreviation; no characters if time zone is unknown / %%=Percent sign.
Any field which contains leading zeros (eg %H represents 1AM as 01) add a hash sign after the percent eg %#H to remove the zeros.
$[date]
for convenience, same as $[time "%d/%m/%y"]
$[path path-id]
A windows pathname. By default it is the desktop.
Possible values for path-id:
desktop, favourites, programs, startmenu, recent, startup, sendto, documents, history, app
Examples:
$[path app] -> "C:\Documents and Settings\Administrator\Application Data"
$[path desktop] -> "C:\Documents and Settings\Administrator\Desktop"
$[path favourites] -> "C:\Documents and Settings\Administrator\Favorites"
$[path sendto] -> "C:\Documents and Settings\Administrator\SendTo"
$[disk ...]
info about disk capacity
Examples:
$[disk drive c free m " / " total m "MB free"] -> "703 / 4697MB free"
$[disk free g] -> "0.687"
$[disk free m] -> "703"
$[disk free k] -> "720196"

Text, images and software are copyright © 2002 Jujusoft. All rights reserved.