Difference between revisions of "Special variables"

From Ketarin
(Created page with "== Main Variables == Additional to the user defined variables, you can use these predefined ones: {| class="wikitable" |- ! Name ! Description ! Example ! Version Required |-...")
 
m (Date/time variables)
 
(3 intermediate revisions by one other user not shown)
Line 54: Line 54:
 
| Ketarin-0.9  
 
| Ketarin-0.9  
 
| 1.1
 
| 1.1
 +
|-
 +
| {preupdate-url}
 +
| Only in pre-download command: Final URL from which the application will be downloaded.
 +
| http://x.y/z.exe
 +
| 1.5
 
|-
 
|-
 
| {property:X}  
 
| {property:X}  
Line 63: Line 68:
 
| UNIX timestamp of the current time, where x represents the time zone offset in hours.  
 
| UNIX timestamp of the current time, where x represents the time zone offset in hours.  
 
| 1285772250  
 
| 1285772250  
 +
| 1.1
 +
|-
 +
| {version}
 +
| FileHippo only: Version of the application
 +
| 4.3.2
 
| 1.1
 
| 1.1
 
|}
 
|}
  
== Additional variables ==
+
== Date/time variables ==
The following variables can be used either as they are (for example {dd}) or like {f:dd}. The latter one refers to the date of the downloaded file, instead of the system date.  
+
The following variables can be used in two ways:
 +
* as they are (for example '''{dd}''') to extract the values from the current '''system''' date.
 +
* preceded by '''"f:"''' (for example '''{f:dd}''') to extract the values from the downloaded '''file''' date.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 76: Line 88:
 
! Version Required
 
! Version Required
 
|-
 
|-
| {dd}  
+
| {dd} or {f:dd}  
 
| Day  
 
| Day  
 
| 10
 
| 10
 
| 1.1
 
| 1.1
 
|-
 
|-
| {ddd}  
+
| {ddd} or {f:ddd}  
 
| Day name  
 
| Day name  
 
| Tue
 
| Tue
 
| 1.1
 
| 1.1
 
|-
 
|-
| {dddd}  
+
| {dddd} or {f:dddd}  
 
| Full day name  
 
| Full day name  
 
| Tuesday  
 
| Tuesday  
 
| 1.1
 
| 1.1
 
|-
 
|-
| {hh}  
+
| {hh} or {f:hh}  
 
|  2 digit hour  
 
|  2 digit hour  
 
| 10
 
| 10
 
| 1.1
 
| 1.1
 
|-
 
|-
| {HH}  
+
| {HH} or {f:HH}  
 
| 2 digit hour (24h)  
 
| 2 digit hour (24h)  
 
| 22
 
| 22
 
| 1.1
 
| 1.1
 
|-
 
|-
| {mm}  
+
| {mm} or {f:mm}  
 
| Minute 00-59  
 
| Minute 00-59  
 
| 10
 
| 10
 
| 1.1
 
| 1.1
 
|-
 
|-
| {MM}  
+
| {MM} or {f:MM}  
 
| Month 01-12  
 
| Month 01-12  
 
| 10
 
| 10
 
| 1.1
 
| 1.1
 
|-
 
|-
| {MMM}  
+
| {MMM} or {f:MMM}  
 
| Month abbreviation  
 
| Month abbreviation  
 
| Oct
 
| Oct
 
| 1.1
 
| 1.1
 
|-
 
|-
| {MMMM}
+
| {MMMM} or {f:MMMM}
 
| Month full name  
 
| Month full name  
 
| December  
 
| December  
 
| 1.1
 
| 1.1
 
|-
 
|-
| {ss}  
+
| {ss} or {f:ss}  
 
| Seconds 00-59
 
| Seconds 00-59
 
| 10
 
| 10
 
| 1.1
 
| 1.1
 
|-
 
|-
| {tt}  
+
| {tt} or {f:tt}  
 
| AM or PM  
 
| AM or PM  
 
| PM
 
| PM
 
| 1.1
 
| 1.1
 
|-
 
|-
| {yy}  
+
| {yy} or {f:yy}  
 
| Year, 2 digits  
 
| Year, 2 digits  
 
| 06
 
| 06
 
| 1.1
 
| 1.1
 
|-
 
|-
| {yyyy}  
+
| {yyyy} or {f:yyyy}  
 
| Year  
 
| Year  
 
| 2006
 
| 2006
 
| 1.1
 
| 1.1
 
|-
 
|-
| {zz}
+
| {zz} or {f:zz}
 
| Timezone offset, 2 digits
 
| Timezone offset, 2 digits
 
| -05  
 
| -05  
 
| 1.1
 
| 1.1
 
|-
 
|-
| {zzz}  
+
| {zzz} or {f:zzz}  
 
| Timezone offset, 2 digits
 
| Timezone offset, 2 digits
 
| -05:00  
 
| -05:00  
 
| 1.1
 
| 1.1
 
|}
 
|}
 +
 +
Note: these variables can't be combined (into a single one, for example);<br />
 +
{f:yyyy-MM-dd} is wrong and will not extract the file date formated like "2006-10-15", {f:yyyy}-{f:MM}-{f:dd} should be used for this instead.

Latest revision as of 21:23, 13 April 2012

Main Variables

Additional to the user defined variables, you can use these predefined ones:

Name Description Example Version Required
{file} Location of the downloaded file (only for commands).Remember to enclose this variable in double quotes (”) if the path contains spaces. c:\…\x.exe 1.1
{filesize} Size of the downloaded file in bytes 1482245 1.1
{root} Root of the application startup path c:\ 1.1
{startuppath} Startup path of the current Ketarin instance (without exe file) c:\…\ 1.1
{category} Category of the application Security 1.1
{appname} Name of the application Ketarin 1.1
{appguid} GUID of the application {AC1DB…} 1.1
{url:ext} Extension of the file that is being downloaded exe 1.1
{url:basefile} Base file name of the file that is being downloaded Ketarin-0.9 1.1
{preupdate-url} Only in pre-download command: Final URL from which the application will be downloaded. http://x.y/z.exe 1.5
{property:X} Property of an application. X is the name of a property (like “Name”). For all property names check the XML that is generated when exporting an application. The element names correspond to the property names. 1.1
{time} or {time-x} or {time+x} UNIX timestamp of the current time, where x represents the time zone offset in hours. 1285772250 1.1
{version} FileHippo only: Version of the application 4.3.2 1.1

Date/time variables

The following variables can be used in two ways:

  • as they are (for example {dd}) to extract the values from the current system date.
  • preceded by "f:" (for example {f:dd}) to extract the values from the downloaded file date.
Name Description Example Version Required
{dd} or {f:dd} Day 10 1.1
{ddd} or {f:ddd} Day name Tue 1.1
{dddd} or {f:dddd} Full day name Tuesday 1.1
{hh} or {f:hh} 2 digit hour 10 1.1
{HH} or {f:HH} 2 digit hour (24h) 22 1.1
{mm} or {f:mm} Minute 00-59 10 1.1
{MM} or {f:MM} Month 01-12 10 1.1
{MMM} or {f:MMM} Month abbreviation Oct 1.1
{MMMM} or {f:MMMM} Month full name December 1.1
{ss} or {f:ss} Seconds 00-59 10 1.1
{tt} or {f:tt} AM or PM PM 1.1
{yy} or {f:yy} Year, 2 digits 06 1.1
{yyyy} or {f:yyyy} Year 2006 1.1
{zz} or {f:zz} Timezone offset, 2 digits -05 1.1
{zzz} or {f:zzz} Timezone offset, 2 digits -05:00 1.1

Note: these variables can't be combined (into a single one, for example);
{f:yyyy-MM-dd} is wrong and will not extract the file date formated like "2006-10-15", {f:yyyy}-{f:MM}-{f:dd} should be used for this instead.