Parameters

When you use AcePaste, AceType or the double-click method to paste a clip directly into an application, AceText scans the clip for parameters if you have ticked the Parameters checkbox for that clip on the AceText Editor. A parameter is a word or alphanumeric sequence between two percentage signs such as %PARAMETER123%. These parameters are like placeholders or variables to be substituted.

When looking for the proper text to substitute the parameter with, AceText first checks whether the parameter is a predefined parameter such as %CLIPBOARD%. These parameters are substituted with their predefined value. If the parameter isn’t predefined, AceText scans the active collection for a clip that has its label set to the name of the parameter (including the two % signs). If such a clip is found, the parameter is substituted with the contents of that clip. If such a clip does not exist in the active collection, then you are prompted to enter a value for the parameter.

Predefined ParametersSubstituted Text
%%A single literal % sign
%CURDATE%The current date in the short date format configured in Windows
%CURTIME%The current time in the short time format configured in Windows
%CURDATETIME%The current date and time in the short date and time formats configured in Windows
%CURYMD%The current date and time in YYYYMMDD format
%CURYEAR%The current year (1601 to 9999)
%CURMONTH%The current month (1 to 12)
%CURMONTHZ%The current month (01 to 12)
%CURWEEK%The current week of the year (1 to 53)
%CURWEEKZ%The current week of the year (01 to 53)
%CURDAY%The current day of the month (1 to 31)
%CURDAYZ%The current day of the month (01 to 31)
%CURHOUR12%The current hour (1 to 12)
%CURHOUR12Z%The current hour (01 to 12)
%CURHOUR24%The current hour (0 to 23)
%CURHOUR24Z%The current hour (00 to 23)
%CURMIN%The current minute (0 to 59)
%CURMINZ%The current minute (00 to 59)
%CURSEC%The current second (0 to 59)
%CURSECZ%The current second (00 to 59)
%CURAMPM%AM or PM indicator for the current time
%CLIPDATE%The date on the clip in the short date format configured in Windows
%CLIPTIME%The time on the clip in the short time format configured in Windows
%CLIPDATETIME%The date and time on the clip in the short date and time formats configured in Windows
%CLIPYMD%The date on the clip in YYYYMMDD format
%CLIPYEAR%The year of the date on the clip (1601 to 9999)
%CLIPMONTH%The month of the date on the clip (1 to 12)
%CLIPMONTH%ZThe month of the date on the clip (01 to 12)
%CLIPWEEK%The week of the year of the date on the clip (1 to 53)
%CLIPWEEKZ%The week of the year of the date on the clip (01 to 53)
%CLIPDAY%The day of the month of the date on the clip (1 to 31)
%CLIPDAYZ%The day of the month of the date on the clip (01 to 31)
%CLIPHOUR12%The hour of the time on the clip (1 to 12)
%CLIPHOUR12Z%The hour of the time on the clip (01 to 12)
%CLIPHOUR24%The hour of the time on the clip (0 to 23)
%CLIPHOUR24Z%The hour of the time on the clip (00 to 23)
%CLIPMIN%The minute of the time on the clip (0 to 59)
%CLIPMINZ%The minute of the time on the clip (00 to 59)
%CLIPSEC%The second of the time on the clip (0 to 59)
%CLIPSECZ%The second of the time on the clip (00 to 59)
%CLIPAMPM%AM or PM indicator for the time on the clip
%CLIPURL%The URL of the clip
%CLIPBOARD%The text on the Windows clipboard
%CLIPHISTORY1%The text of the topmost clip in the ClipHistory
%CLIPHISTORY2%The text of the 2nd clip in the ClipHistory
%CLIPHISTORY999%(etc.)

When the Parameters checkbox is ticked, AceText highlights all predefined parameters using the “Editor: Built-in parameter” color. All other parameters are highlighted with the “Editor: Custom parameter” color. You can find these colors at the bottom of the list of individual colors when you customize the color palette.

The %CURWEEK% and %CLIPWEEK% parameters follow the ISO 8601 standard. Monday is the first day of the week. If January 1st falls on a Friday, Saturday, or Sunday, then it falls in week 52 or 53 of the previous year. In this case, if you use %CURYEAR% or %CLIPYEAR% after their respective %CURWEEK% or %CLIPWEEK% parameter then %CURYEAR% or %CLIPYEAR% will be sustituted with the number of the previous year, which is the year that the week started in. So if the clip’s date is January 1st, 2022, which was on a Saturday, then “%CLIPWEEK%/%CLIPYEAR%” is substituted with “52/2021”. But “%CLIPMONTH%/%CLIPYEAR%” is substituted with “1/2022”. “%CLIPYEAR%/%CLIPWEEK%” would be substituted with “2022/52” because the parameter for the week has to come before the parameter for the year for it to be able to override the year number.

How Clips Are Found and Substituted

If the parameter isn’t predefined then AceText scans the active collection for a clip that has its label set to the name of the parameter. Only the collection containing the clip you’re pasting is searched. Clips in other collections that you may have open are ignored. There are a number of rules involved with this substitution.

First, the label of the clip must consist solely of the parameter, including its two percentage signs. Parameters are case insensitive, so %PARAMETER% can be substituted with a clip that has %parameter% as its label. If the collection has multiple clips with the parameter as their label, AceText substitutes only the first one. AceText doesn’t even look to see if there is another.

If a clip with label %PARAMETER% has a before and after part then another clip can use the parameter %PARAMETERBEFORE% to reference the “before” part of the clip labeled %PARAMETER% and %PARAMETERAFTER% to reference the “after” part.

If you also ticked the Parameters checkbox for the clip with the label matching the parameter then AceText substitutes all parameters in that clip as well. It goes through all three steps (predefined, clip, prompt). If AceText needs to prompt, it simply adds the substitution clip’s parameters to the list of parameters to be substituted for the clip you’re trying to paste.

AceText does not substitute a parameter within a clip if the same clip has that parameter as its label. This prevents AceText getting stuck in an infinite loop substituting a parameter with the same clip containing the same parameter. You can take advantage of this to disable a specific parameter. If a clip has %DONTREPLACE% as its label and also has %DONTREPLACE% as its body text then AceText finds this clip whenever another clip containing %DONTREPLACE% needs to be pasted. It will substitute %DONTREPLACE% with %DONTREPLACE%, effectively doing nothing. %DONTREPLACE% will still be highlighted as a parameter in clips with the Parameters checkbox ticked. But it will be pasted unchanged. You won’t be prompted for it.

How AceText Prompts for Parameters

When one or more parameters aren’t predefined and aren’t used as the label of a clip then AceText pops up a form listing all the parameters. All of them will default to the value you entered when you last pasted a clip from the current collection using these parameters. You can also access a history list for previously used values. The history lists are maintained separately for each collection, but jointly for all the clips in the collection.

Depending on the parameter’s name, AceText expects a different kind of value. For parameters ending in DATETIME%, it expects a date and time. For DATE% and TIME% it expects a date or time only. For FILENAME% and FILECONTENT% you’ll need to type in a path to a file, or select a file by browsing your computer’s drives. AceText then substitutes the parameter either with the full path to the file, or the contents of the file. For all other parameters, AceText allows you to type in any text.