What are variables and how do I use them in my project?
One of the most powerful features of Acquire is its ability to use Variables. Variables are basically names you give to post boxes that can themselves contain information or values. You can create a variable called numberofpictures and use it to store how many pictures you have (likewise it may be called fred or gobbledigook but you are more likely to remember what numberofpictures is used for).
In most places in the editor, you can use variables instead of manually putting a value, which can be immensely useful in reducing the amount of work you need to do. Acquire knows that you mean to use a variable by using two dollar signs in front of the variable name ($$). There are also some special variables that Acquire creates itself that you can use in your projects. These are signified by two dollar signs and an underscore ($$_).
As an example, you could put Hello & Welcome to our Store in a text box on a page.
Or you could put $$message into the text box and somewhere set (see shortly to find out how) $$message to be Hello & Welcome to our Store and it will show the same thing.
Or you could put Hello & Welcome to our $$message store in into the text box and set $$message to be London, Paris, Rome, etc on the respective player. By doing this, you can simply make and manage one page, and by setting the variables appropriately, all of the players will show a different message, especially useful for projects deployed to different locations.
As described above, you can use variables in most places in Acquire. You can use it as the file name of a piece of media, or as part of a URL for CyberBrowser or one of the helpers, or many more.
You can set and change variables in a number of places in Acquire:
- When a page shows/exits (on the Page control in the Page Designer)
- When an item is clicked
- In an Auto-line event in a playlist
- In an ACQ (see ACQ documentation for more information)
- In a helper (see helper documentation for more information)
- When Acquire Player starts (uses the variables.ini file, or create one)
- From external programs
- Using the CiY code management system
- Within Adobe Flash animations
However, the best location to change variables is by using the Group Editor and setting the groups to have specific values set for specific variables - then any players assigned to that group will receive those variables.
System variables are ones which are typically created from within Acquire's system and can be used to discover information for use in your projects.
$$_channelscript - if this is set to a valid playlist (script) name. This playlist will play instead of the one scheduled to play from the editor. The playlist name must include the complete filename (including the .aqs suffix)
These variables are available for read access at any time and cannot be changed.
They provide your applications and any ACQs or helpers with details of system values
- $$_time - Current Time as specified in windows locale
- $$_date - Current Date as specified in windows locale
- $$_Hour12 - Current Hour of day in 12 hour format (see AMPM flag)
- $$_Hour24 - Current Hour in 24 hour format
- $$_AMPM - Flag showing AM (morning) or PM (evening)
- $$_min - Minute of Hour
- $$_sec - Second
- $$_day – The day of the month
- $$_dow –The current day of the week (Monday, Tuesday, etc)
- $$_month – The month of the year (numerical)
- $$_monthname – the month of the year (January, February, etc)
- $$_year – The current year
- $$_datefmt- This uses the standard functions to choose the date and time fields. Choose from:
- c - shortdateformat + ' ' + longtimeformat
- d - day of month
- dd - day of month (leading zero)
- ddd - day of week (abbreviation)
- dddd - day of week (full)
- ddddd - shortdateformat
- dddddd - longdateformat
- m - month
- mm -month (leading zero)
- mmm - month (abbreviation)
- mmmm -month (full)
- y - year (2 digits)
- yy - year (two digits)
- yyyy - year (with century)
- h - hour
- hh -hour (leading zero)
- n - minute
- nn - minute (leading zero)
- s - second
- ss - second (leading zero)
- t - shorttimeformat
- tt - longtimeformat
- am/pm - use 12 hour clock and display am and pm accordingly
- a/p -use 12 hour clock and display a and p accordingly
- / - insert date seperator
- : - insert time seperator
- "xx" - literal text
- 'xx' - literal text
- Z -milliseconds
- Zzz - milliseconds (leading zero)
- $$_now - Current Date and Time as specified in windows locale
- $$_playername - Player name as set in Engineer Settings / on the PLUS! Network
- $$_playerdesc - Player description as set in Engineer Settings
- $$_monitorno - ID of the monitor Acquire is set to display on
- $$_machineid - Unique ID of the player
- $$_sequencenumber - If using more than one player at a site (e.g. using synchronisation), this is the position in the sequence.
- $$_errorhappened - Details of whether an error in a deployment occurred since the player was started (0 or 1)
- $$_lasterror - Text Details of any errors the last error since the player was started
- $$_projectid - Unique project ID (also used as foldername for deployments)
- $$_projectname - Currently chosen project name
- $$_projectmedia - Currently chosen project Media folder complete path
- $$_projectscripts - Currently chosen project Scripts folder complete path
- $$_projecthelpers - Currently chosen project Helpers folder complete path
- $$_pageid - current page ID
- $$_pagename - current page name
- $$_ipaddress - IP address of the player (note this is the first active network connection)
- $$_macaddress- MAC address of the player (note this is the first active network connection)
- $$_screenwidth - Current screen resolution
- $$_screenheight - Current screen resolution
- $$_volumeleft – Volume of the Master Mixer (Left Channel) 0 to 100
- $$_volumeright – Volume of the Master Mixer (Right Channel) 0 to 100
- $$_NULL: - Does nothing, useful if you want to stop something being picked up as a variable (e.g.: $$thisid$$_null:.jpg would work out $$thisid and add .jpg on the end rather than seeing $$thisid.jpg as the variable name)
- $$_EVAL - Simple expression evaluator. For example $$_EVAL[ 5+5 ] will return 10, or $$_EVAL[ $$var1 + $$var2 ] will add the vaules in $$var1 and $$var2, so when these are 3 and 4 the result will be 7, whereas if they are 'hello' and 'there' the result will be 'hellothere' (make sure you put spaces between each part)
- $$_RSS – Access ALL RSS Data as a variable. This makes it much more flexible
- Usage: $$_rss[feedid,storyindex,command]
feedid is shown in the RSS helper.
StoryIndex is a number starting at 0 of the story to show
- Command is what you want
- Title - Story Title
- Story - Story content
- Mediafile - Media related to this story
- Mediadesc - Description of the media
- url - URL to the full story
- pubdate - Published date of the story
This is different, format is $$_rss[feedid, storyindex, pubdate, format]
“format” field is the same parameters as $$_datefmt
- $$_SETIF – Inline command. Sets a variable to a value if a specific condition is met.
- $$_setif[$$variable,value,expression] E.g.:
- $$_setif[$$myvar,1, $$var2 = 10] would set $$myvar to 1 if $$var2=10
- $$_JUMPIF – Inline command. Jumps to a different page if a specific condition is met.
- $$_QUITIF – Inline command. Quits the current page if a specific condition is met
- $$_TIMEOUTIF – Inline command. Times out the current page if a specific condition is met. $$_timeoutif[expression]
- $$_ticks – Returns the number of milliseconds since Windows loaded. This number will reset about every 22 days. Useful for measuring timings.