Skip to content

Script Commands

Bashar Astifan edited this page Apr 23, 2023 · 14 revisions

Back to Commander

General Commands

Defines

define: used to define/update new variable

COMMAND STRUCTURE: define [variableName];, variableValue

if the variable already defined will be updated with the new value

You can use value from another variable as ID

EXAMPLE: define [variableName];, [sourceVariableName]

As Commander compiler based on text replacements.. large text could break the script this will help to resolve the issues when your data contains multi lines


set: used to set new value for specific variable

COMMAND STRUCTURE:

set [variableName];, variableValue

IS IT SAME AS define?

No, with set command you can deal with specific values as listed below:

  • ++: set [variableName];, ++
  • --: set [variableName];, --
  • +(varaible or number): set [variableName];, +value
  • -(variable or number): set [variableName];, -value
  • *(variable or number): set [variableName];, *value
  • /(variable or number): set [variableName];, /value
  • any string/numeric value: set [variableName];, value

you can also increase the value directly:

[variableID]++, [variableID]--

If you want to set value from another variable as ID

EXAMPLE:

define [variableName];, [sourceVariableName]

this will help to resolve the issues when you data contains multi lines


func: used to define/update new function

COMMAND STRUCTURE:

func [functionName];, (command)

use call command to invoke the function

EXAMPLE:

func [variableName]{
command1
command2
}

If you want inline syntax, you can define multiple command by split them with !#! or \n

func [variableName];, (command1!#!command2!#!command3)

to call the function use call command:

EXAMPLE: call [functionName]

EXAMPLE (With Parameters): call [variableID]|paramName1:Value|paramName2:Value..etc

NOTE: Don't define function inside statement


call: run commander command from variable

COMMAND STRUCTURE:

call [variableID]

This will solve the issues that could happen because of multiple internal commands

Use definec to define new command with variable

or get the command from file

Please note that call command can be used with sub command

like you can use it with loop, each..etc

You can send custom param to the define command

EXAMPLE:

call [variableID]|paramName1:Value|paramName2:Value..etc


clean/clear: clean all stored variables, storage items, processes, timers..etc

COMMAND STRUCTURE:

clean/clear all

if you want to avoid any conflict or unwanted results use this command at the top of each script



Includes

include: used to include another script into the current one

COMMAND STRUCTURE:

include [fileID]


includel: used to include another script into the current one

COMMAND STRUCTURE:

includel fileLocation

the file should be available in the files storage

you can include any file in the script folder by it's name (for script bundle)

EXAMPLE:

includel extraContent.wutc



Strings

regex: extract string using regex

COMMAND STRUCTURE:

regex [variableID];, pattern;, [targetID]

pattern like:

define [sourceID];, Welcome To (WUT)
regex [testID];, \(.*\);, [sourceID]

testID will be (WUT)

be aware to the special chars \ - ( - < -> and don't forget to add \ before them \ - ( - < - >

if you got any parsing error message then you have special char in your pattern


regexg: extract string using regex with group

COMMAND STRUCTURE:

regexg [variableID];, pattern;, group;, [targetID]

pattern like:

define [sourceID];, Welcome To (WUT)
regexg [testID];, Welcome (?<middle>\w+);, middle;, [sourceID]

testID will be To

as you can see this will return only the requested group

be aware to the special chars \ - ( - < -> and don't forget to add \ before them \ - ( - < - >

if you got any parsing error message then you have special char in your pattern


regexc: extract string collection using regex with group

COMMAND STRUCTURE:

regexc [variableID];, pattern;, group;, [targetID]

pattern like:

define [sourceID];, Welcome To (WUT) Welcome test collection
regexc [testID];, Welcome (?<middle>\w+);, middle;, [sourceID]

testID will be To,test

as you can see this will return only the requested group

be aware to the special chars \ - ( - < -> and don't forget to add \ before them \ - ( - < - >

if you got any parsing error message then you have special char in your pattern


replace: replace content with another content

COMMAND STRUCTURE:

replace [targetID];, original;, replacement

The results will be saved to the same variable

you can replace multiple words at once

replace [targetID];, w1|w2|w3;, r1|r2|3

You can replace multi target with one source:

replace [targetID];, w1|w2|w3;, r1


replaced: replace content with another, then define result

COMMAND STRUCTURE:

replaced [outputVariable];, [targetID];, original;, replacement

outputVariable will be defined by default

multi replace available as in replace command


replacer: replace content with another content using regex

COMMAND STRUCTURE:

replacer [outputVariable];, [targetID];, regex;, replacement

outputVariable will be defined by default

multi replace available as in replace command but use '[#]' separator instead of |


substr: get sub string using start, end index

COMMAND STRUCTURE:

substr [variableID];, [targetID];, startIndex;, endIndex

if you want to set 'end' to the last index use 'last' instead of number


length: get length for string variable

COMMAND STRUCTURE:

length [variableID];, [targetID]



Arrays

Basically Commander array is string value divided by specific char, default is ,

most array commands will give you the option to set the separator char

count: get items count for array variable

COMMAND STRUCTURE:

count [variableID];, [targetID];, separator

  • Set separator as #links to extract links from the content (1.3.0+)

subarr: get sub array using start, end index

COMMAND STRUCTURE:

subarr [variableID];, [targetID];, separator;, startIndex;, endIndex

if you want to set 'end' to the last index use 'last' instead of number


unique: delete duplicated values

COMMAND STRUCTURE:

unique [variableID];, [arrayID];, separator

EXAMPLE:

define [arrayID];, "A", "B", "C", "D","A"
unique [cleanArray];, [arrayID];, ,

cleanArray-> "A", "B", "C", "D"

you can use the [arrayID] as string instead of ID, just write the arrayID without []


sort: will sort data by AES, DESC

COMMAND STRUCTURE:

unique [variableID];, [arrayID];, separator;, sortType

sortType: can be aes or desc

EXAMPLE:

define [arrayID];, "A", "B", "C", "D","A"
unique [cleanArray];, [arrayID];, ,;, aes

cleanArray-> "A","A", "B", "C", "D"

you can use the [arrayID] as string instead of ID, just write the arrayID without []


reformat: merge two values into one

This is very important command for arrays, it will help to build values for any GUI command

COMMAND STRUCTURE:

reformat [variableID];, values1;, values2;, mixSymbol;, separator

EXAMPLE:

define [Values1];, "United State", "United Kingdom", "China"
define [Values2];, "us", "uk", "cn"
reformat [CountriesArray];, Values1;, Values2;, :;, |

CountriesArray -> "United State":"us"|"United Kingdom":"uk"|"China":"cn"

you can use these values into list or combo

if you want to remove " you can call replace command

replace [CountriesArray];, ";,

then the output will be:

CountriesArray -> United State:us|United Kingdom:uk|China:cn

Note: The command currently work only with values separated with ,

so if your input value using something else use replace command first


Working with index:

How to get specific index from variable?

if you sure that your variable contains value as array use this: variableID:(index,separator)

index can be number or first, last

EXAMPLE:

In storage our data is like this: variableID -> value1, value2, value3

with this command: variableID:(last,,) will return value3

or this command: variableID:(1,,) will return value2

you can also get the item with it's index (whatever it was text or array):

[variableID][index]



Areas

area: used to define custom area like 'label' in CMD

COMMAND STRUCTURE:

area [areaName];, (command)


jump: used to jump to specific area like 'goto' in CMD

COMMAND STRUCTURE:

jump [areaName]



Runtime

delay: used to delay the script for specific time

COMMAND STRUCTURE:

delay time

time in milliseconds


break: used to break the execution and end the script

COMMAND STRUCTURE:

break message


breakwhen: used to break the execution and end the script on specific condition

COMMAND STRUCTURE:

breakwhen condition;, message

check 'is' command below for condition structure

you can use fixed condition 'offline' to break when no internet connection

check also waitic (for wait until internet active)



Batch Script

cmd: run cmd command from variable

COMMAND STRUCTURE:

cmd [variableID]

check definec / func for commands define


cmdout: run cmd command and save the output result to variable

COMMAND STRUCTURE:

cmdout [outputID];, (command)



Conditions

is: used to execute command when specific condition is true

COMMAND STRUCTURE:

is statement;, (command)

statement accept the following operators:

  • <
  • >
  • >=
  • <=
  • equ
  • ==
  • neq
  • !=
  • lss
  • leq
  • gtr
  • geq
  • ~~ (contains)
  • !~ (not contains)
  • @ (startWith)
  • # (endWith)

EXAMPLE:

is variable<18;, (break Age is not allowed)

variable (left side) can be also [variableID], because long data/text with lines will break the script

  1. You can test upto 3 values instead of two

is variable==11|18|22;, (break Age is not allowed)

  1. You can run cmd commands with 'is'

  2. You can use mulitple commands with 'is'

EXAMPLE:

is variable>0{
command..
command..
}
  1. You can get lower case content for the left side

is lower:content~~test;, (command)

  1. Internal multiple is is possible

else: used to execute command after 'is' condition is false

COMMAND STRUCTURE:

else statement;, (command)

if you don't have extra statement just use 'else'

if you want to use else without statement in one line do the following:

else (command)

multi line is possible

EXAMPLE:

is variable>0{
.....
}else statement{
.....
}

any other details same exactly as 'is' command



Loops

loop: create loop with specific rounds

COMMAND STRUCTURE:

loop startIndex;, endIndex;, step;, (command)

To get the current index use $currentIndex

  • You can run cmd commands directly
  • You can use skip, break in-commands

skip: will skip the current iteration

break: will break the loop

if you want to execute multiple commands the do these steps:

  1. Create func
  2. Call the function with call inside the (command)

EXAMPLE:

func [test]{
..command..
..command..
}

loop startIndex;, endIndex;, step;, (call [test])

each: create loop with specific value (for arrays)

COMMAND STRUCTURE:

each [arrayID];, separator;, (command)

To get the current value use $currentValue

  • You can run cmd commands directly
  • You can use skip, break in-commands
  • Set separator as #links to extract links from the content (1.3.0+)

skip: will skip the current iteration

break: will break the each loop



Files / Folders

folder: used to select specific folder

COMMAND STRUCTURE:

folder [folderID];, extensions

extensions should be like .appx|.msix

folderID will be stored during the session so yo can use it from any other script

folderID will be replaced with folder path during the compiling

  • use 'name:folderID' to get ONLY the name not the full path
  • use 'size:folderID' to get folder total size formatted like 15.3 MB
  • use 'sizelong:folderID' to get the total size in bytes like 15300000
  • use 'date:folderID' to get modified date & time
  • use 'count:folderID' to get total files count

folderf: used to select specific folder inside another folder (without picker)

COMMAND STRUCTURE:

folderf [folderID];, [parentID];, folderName


file: used to select specific file

COMMAND STRUCTURE:

file [fileID];, extensions

extentions should be like .appx|.msix

fileID will be stored during the session so yo can use it from any other script

fileID will be replaced with file path during the compiling

  • use 'name:fileID' to get ONLY the name not the full path
  • use 'size:fileID' to get file size formatted like 2.5 MB
  • use 'sizelong:fileID' to get file size in bytes like 2500000
  • use 'date:fileID' to get modified date & time
  • use 'nameonly:fileID' to get name only without extension
  • use 'extonly:fileID' to get extension only

filef: used to select specific file inside folder (without picker)

COMMAND STRUCTURE: filef [fileID];, [folderID];, fileName


filel: used to select specific file inside folder (without picker) by location

COMMAND STRUCTURE:

filel [fileID];, fileLocation

the file should be available in the files storage

if fileLocation contains " it will be removed by default


files: used to select specific files (multiple selection)

COMMAND STRUCTURE:

files [filesID];, extensions

extensions should be like .appx|.msix

filesID will be stored during the session so yo can use it from any other script

filesID will be replaced with files paths during the compiling

when no files selected the filesID will be null

OUTPUT EXAMPLE: File1Path, File2Path, File3Path

  • use 'name:filesID' to get only the name not the full path
  • use 'size:filesID' to get file size formatted like 2.5 MB, 1.5 MB, 3 KB
  • use 'sizelong:filesID' to get file size in bytes like 2500000, 1500000, 3000
  • use 'count:filesID' to get total files count
  • use 'date:filesID' to get modified date & time
  • use 'namesize:filesID' to get name and size in this format fileName (Size)
  • use 'nameonly:filesID' to get name only without extension
  • use 'extonly:filesID' to get extension only

filesf: used to select specific files from folder (without picker)

COMMAND STRUCTURE:

filesf [filesID];, [folderID];, extensions

filesID will handle the selected files

extensions should be like .appx|.msix

descriptions same as files command


pick: used to re-select specific file/folder

COMMAND STRUCTURE:

pick [targetID]

extensions should be like .appx|.msix


exists (1.0.4+): used to check if the file exists using the full path

COMMAND STRUCTURE:

exists [variableID];, fullPath

will return true or false

EXAMPLE:

exists [testID];, c:\text.txt
is testID==true{
//Your code goes here
}

crc (1.0.4+): used to get unique identifier for any file using fileID

COMMAND STRUCTURE:

crc [variableID];, [fileID]

it's very helpful to compare the files


crcl (1.0.4+): used to get unique identifier for any file using full path

COMMAND STRUCTURE:

crcl [variableID];, filePath

it's very helpful to compare the files the file should be available in the files storage


get: used to get file content

COMMAND STRUCTURE:

get [targetID];, [variableID]

if variableID not defined before will be automatically defined

simple content will work fine with dialogs


getl: used to get file contents by location

COMMAND STRUCTURE:

getl fileLocation;, [variableID]

this command will look into the storage and get the file when it's exists

the file should be available in the files storage


append: used to append content to specific file

COMMAND STRUCTURE:

append [targetID];, content

content can be [variableID]


write: used to write content to specific file

COMMAND STRUCTURE:

write [targetID];, content

content can be [variableID]


open: used to open file/folder with the default launcher by ID

COMMAND STRUCTURE:

open [targetID]


openl: used to open file/folder with the default launcher by location

COMMAND STRUCTURE:

openl fileLocation

this command will look into the storage and open the file when it's exists

the file should be available in the files storage

if fileLocation contains " it will be removed by default


openf: used to open file inside folder

COMMAND STRUCTURE:

openf [folderID];, fileName

if fileName contains " it will be removed by default


create: used to create new folder

COMMAND STRUCTURE:

create [folderID];, [parentID];, folderName

folderID will be added to the session storage


createf: used to create new file inside existed folder

COMMAND STRUCTURE:

createf [fileID];, [folderID];, fileName

fileID will be added to the session storage


delete: used to delete folder or file by ID

COMMAND STRUCTURE:

delete [targetID]

targetID can be for folder or file and compiler will search for it automatically


deletef: used to delete file inside folder

COMMAND STRUCTURE:

deletef [folderID];, fileName


play: play audio file/SFX

COMMAND STRUCTURE:

play [folderID];, fileName;, volume

volume in double between 0.0 - 1.0

To use app sound effects:

play [$Assets];, SFX\$AppIcons\error.mp3;, 1.0

Available sfx:

  • ac-off.mp3
  • ac-on.mp3
  • alert.mp3
  • error.mp3
  • no-results.mp3
  • started.mp3

Working with path:

You can get custom part of the path in case your variable is path

available options: name, nameonly, extonly

EXAMPLE:

define [pathVariable];, C:\testfile.exe

//Get 'testfile.exe'
name:pathVariable 

//Get 'testfile'
nameonly:pathVariable

//Get '.exe'
extonly:pathVariable


Waiters

hold: will hold all the script processes

COMMAND STRUCTURE:

hold state

state can be 0 or 1

You can use the waitb command to be able to release the hold state


waitf: will hold the script until the specific file found

COMMAND STRUCTURE:

waitf fileName;, waitMessage;, timeout;, (timeoutCommand)

set timeout to 0 to ignore the timeout limit OR don't include it

timeoutCommand will be called only if the file not found during the specific time

if you want to delete the file after wait use '|1' with the name

EXAMPLE:

waitf test.txt|1;, Please wait..

again don't add timeout if you don't want to use it

timeout in milliseconds

because of UWP restriction this command will look in three places:

  • cache folder
  • downloads folder
  • script folder (if possible)

if you have your own folder and already selected use waitfd


waitfd: will hold the script until the specific file found

COMMAND STRUCTURE:

waitfd [folderID];, fileName;, waitMessage;, timeout;, (timeoutCommand)

set timeout to 0 to ignore the timeout limit OR don't include it

timeoutCommand called only if the file not found during the specific time

EXAMPLE:

waitfd [$LocalFolder];, test.txt|1;, Please wait..

other details same as waitf command


waitn: will hold the script until the notification pressed

COMMAND STRUCTURE:

waitn waitTitle;, waitMessage;, timeout

set timeout to 0 to ignore the timeout limit

don't add timeout if you don't want to use it

timeout in milliseconds


waitd: will hold the script until specific file downloaded

COMMAND STRUCTURE:

waitd [downloadID];, waitMessage

this command interact with download command only (not the repos downloads)


waite: will hold the script until specific file extracted

COMMAND STRUCTURE:

waite [downloadID];, waitMessage

this command interact with download command only (not the repos downloads)


waiti: will hold the script until specific file installed

COMMAND STRUCTURE:

waiti [queueID];, [outputState];, waitMessage

this command interact with download command only (not the repos downloads)

queueID or downloadID

outputState will help you to know if the app installed or not

because the waiti will be skipped if the app installed or failed


waitic: will hold the script until internet available

COMMAND STRUCTURE:

waitic message


waitp: will hold the script until the progress reach 'x' percentage

COMMAND STRUCTURE:

waitp waitMessage;, targetPercentage

targetPercentage as number like 40, 50 or 100..etc


waitpr: will hold the script until the specific process start/end

COMMAND STRUCTURE:

waitpr waitMessage;, processName

processName: Executable File Name like svchost.exe

if appDiagnostics is not allowed the command will be ignored

if you want to wait until the process end add '!' before the name

EXAMPLE:

waitpr waitMessage;, !processName


waitb: used to show break-wait button near to the script

COMMAND STRUCTURE:

waitb buttonTitle

use waithb buttonTitle command to hide the button



Links / Downloads

response: used to check the response for specific URL

COMMAND STRUCTURE:

response [responseID]; url

will return 0 if response failed

or will return StatusCode..:

Ok: the request susccess

NotFound

404: Page Not Found

for more read about StatusCodes: Click Here

use [responseID]|C to get the response content (in command structure)

use cancelb to cancel the request if you want


download: used to download file by link

COMMAND STRUCTURE:

download [downloadID];, fileLink

use waitd if you want to wait until the file downloaded

by default new variable will be defined to handle the file name

just place downloadID to get the file name


downloadf: used to download files form links in a file

COMMAND STRUCTURE:

downloadf [downloadID];, [folderID];, fileName

All downloads will be added to Group Downloads section


downloadfd: used to download files form links in a file

COMMAND STRUCTURE:

downloadfd [downloadID];, [folderID];, fileName;, [saveFolderID]

All downloads will be added to Group Downloads section You can download from list of links in variable

EXAMPLE:

downloadfd [downloadID];, [variableID];, local;, [saveFolderID]

if your list contains links separated with custom char use: local:(,)

You can use some custom option with the fileName:

fileName|IE and fileName|SD

you can also use both of them fileName|SD|IE

IE: mean to ignore the files if already exists

SD: mean to add the download file to Single downloads queue

You can use custom save folder name:

[saveFolderID]|customFolderName


cancelb Show cancel button under the script

COMMAND STRUCTURE:

cancelb buttonTitle

to hide the button use cancelhb buttonTitle

the button also will be hidden once the script finished/terminated this command for downloadf / downloadfd / response commands only


browse: used to invoke the built-in browser and open specific website

COMMAND STRUCTURE:

browse webLink


luri: used to launch file, app, link using URI

COMMAND STRUCTURE:

luri uri


lurif: used to launch app with file attachment by URI

COMMAND STRUCTURE:

lurif uri;, [fileID]

This command available from 1.4.21+



Queue

register: used to register package by AppxManifest.xml

COMMAND STRUCTURE:

queuef [resultID];, fullpath;, devmode

devmode: 1 (developer mode), 0 (normal mode)

resultID will handle the output result

this command available in 1.4.21+


queuef: used to queue file inside folder

COMMAND STRUCTURE:

queuef [queueID];, [folderID];, fileName

if fileName contains " it will be removed by default

if the file is media, commander will launch media viewer


queuel: used to queue file by it's location

COMMAND STRUCTURE:

queuef [queueID];, fileLocation

if fileLocation contains " it will be removed by default

this command will look into the storage and queue

if the file is media, commander will launch media viewer

the file should be available in the files storage


queuer: remove the downloaded / added file from the queue

COMMAND STRUCTURE:

queuer [downloadID]

this command interact with download / queuef / queuel commands only

downloadID or queueID

Use $ScriptID to remove the current script from the queue



Dialogs

The default values for dialogs buttons(button1->1, button2->2) unless you customize it

info: used to display info dialog with one button

COMMAND STRUCTURE:

info title;, message;, button

message can be styled by using the following words:

Red Words: important | be careful | error

Orange Words: note | note 1 | note 2 | warning

Green Words: remember | report | success

(upper or lower) no rule for the case (important, Important or IMPORTANT)

for new line add \n between the lines

Add |telnet to button to prevent the text wrapping

You can use the variable as ID in case it's contains lines

EXAMPLE: info title;, Hello [variableID];, button


text: used to display text dialog (from variable Only)

COMMAND STRUCTURE:

text title;, [variableID];, button

Add |telnet to button to prevent the text wrapping


ask: used to display question dialog with two buttons

COMMAND STRUCTURE:

ask [dialogID];, title;, question;, button1;, button2

you can add default value to any button: button|defaultValue

message can be styled as in the info dialog

for new line add \n between the lines

You can use the variable as ID in case it's contains lines

EXAMPLE:

info title;, Hello [variableID];, button


input: used to display input dialog with two buttons

COMMAND STRUCTURE:

input [dialogID];, title;, placeholder;, button1;, button2

you can add default value to any button: button|defaultValue

the default value for button1 will be returned only if the input is empty

input can be extended with descriptions option

EXAMPLE:

input [dialogID];, title;, descriptions;, placeholder;, button1;, button2


slider: used to display slider dialog with two buttons

COMMAND STRUCTURE:

slider [dialogID];, title;, range;, button1;, button2

range structure is: min|max|step

you can use min|max|step|after|before

you can use |#P in anywhere with the range to convert the value from percentage to double, exam.. 125% -> 1.2 [0|250|1|#P|%]

after, before will be added to the preview text

EXAMPLE:

slider [ageDailog];, Select your age;, 15|55|1;, Confirm|18;, Cancel

you can add default value to any button: button|defaultValue


combo: used to display combo dialog with two buttons

COMMAND STRUCTURE:

combo [dialogID];, title;, list;, placeholder;, button1;, button2

list structure is: item1|item2|item3...etc

EXAMPLE:

you can add default value to any button: button|defaultValue

if you want to use View text and value:

list structure is: item1:value1|item2:value2|item3:value3...etc

in this case you the value for the default button value: button|value1

using reformat command:

reformat [refValues];, name:filesID;, filesID;, :;, |
combo [comboID];, title;, refValues;, placeholder;, Select|refValues:(first,,);, Cancel

EXPLAIN:

reformat will merge the two values into one

Values 1: Name1, Name2..etc

Values 2: Path1, Path2..etc

refValues: Name1:Path1|Name2:Path2..etc


comboi: used to display combo dialog with extra input

COMMAND STRUCTURE:

comboi [dialogID];, title;, list;, placeholder;, extraElement;, button1;, button2

descriptions same as combo command

extraElement can be: input or slider

input structure: input|placeholder (empty input will return null)

slider structure: slider|min|max|step (same as rang in slider command)


list: used to display list dialog with two buttons

COMMAND STRUCTURE:

list [dialogID];, title;, data;, header;, button1;, button2

header is the header text

data structure is: item1|item2|item3..etc

this dialog will return the value of the selected item

same data list structure as in combo applied

when no selection will return null


listm: used to display multi-select list dialog with two buttons

COMMAND STRUCTURE:

listm [dialogID];, title;, data;, header;, button1;, button2

header is the header text

data structure is: item1|item2|item3..etc

this dialog will return the value of the selected items (as array)

SAMPLE OUTPUT:

value1, value3, value 5..etc

other descriptions same as list command

same data list structure as in combo applied

you can use '*' in button1 default value to select all the items

EXAMPLE: button1|*

when no selection will return null


image: used to display image dialog with two/one buttons

COMMAND STRUCTURE:

image [dialogID];, title;, [imageFile];, button1;, button2

image [dialogID];, title;, descriptions;, [imageFile];, button1;, button2

you can add default value to any button: button|defaultValue

if you want only one button just use empty value for button2


video: used to display video dialog with two/one buttons

COMMAND STRUCTURE:

video [dialogID];, title;, [videoFile];, button1;, button2

video [dialogID];, title;, descriptions;, [videoFile];, button1;, button2

you can add default value to any button: button|defaultValue

if you want only one button just use empty value for button2



Visuals

icon: used to change the script icon (inside downloads queue)

COMMAND STRUCTURE:

icon fullpath

you can use built-in icons with this URI:

ms-appx:///Assets/Icons/$AppIcons/security.png


status: used to display custom message to the script status

COMMAND STRUCTURE:

status message


statust: used to display custom message to the script type

COMMAND STRUCTURE:

statust message


statusd: used to display custom message to the script size

COMMAND STRUCTURE:

statusd message


statuslink: used to link the status message with file content

COMMAND STRUCTURE:

statuslink [folderID];, fileName

this command is very helpful if you want to track status from .bat file

or to track the telnet command status

the command will hold the script until the file created

to stop the monitor process just call status command


progress: used to display custom message to the script status

COMMAND STRUCTURE:

progress percentage

percentage as number only, don't add '%' to the value

Set progress to -1 to hide it

Set progress to fake show fake progress move

use progress release to make the progress complete (if fake)

regarding to fake, you can set the maximum random value like: fake|1000

so the fake progress will get random delay between 0 to 1000 milliseconds


progresslink: used to link the progress value with file content

COMMAND STRUCTURE:

progresslink [folderID];, fileName

this command is very helpful if you want to track progress from .bat file

or to track the telnet command progress

the command will hold the script until the file created

to stop the monitor process just call progress command


notify: used to push custom notification

COMMAND STRUCTURE:

notify title;, message;, timeout

set timout to 0 to ignore the timeout limit

timeout in milliseconds


notifyl: used to push custom local notification

COMMAND STRUCTURE: notifyl type;, message;, icon;, timeout

timeout in milliseconds

type: can be normal, success, error, warn

or any custom color (direct [red, green..etc] or hex [#FF0000])

type will be used only to set the background color

use 0 if you don't need icon

for more icons Click Here

and select use only the unicode like: E700


log: used to log custom message to the app local log with display

COMMAND STRUCTURE:

log message

you can log from varaible

EXAMPLE: log [variableID]|V


barp: used to show status bar progress (only for mobile)

COMMAND STRUCTURE:

barp state

state: 0 means stop, 1 means start

by default status bar progress will be stopped once the script finished



Encryption

encrypt: encrypt file

COMMAND STRUCTURE:

encrypt [fileID];, [folderID]

App key will be used for encryption

folderID: used as save folder


decrypt: decrypt file

COMMAND STRUCTURE:

decrypt [fileID];, [folderID]

App key will be used for decryption

folderID: used as save folder



Forms

element: used to create new element for settings page

COMMAND STRUCTURE:

element [elementID];, type;, value;, description;, hint;, tabName

type: Combo - Switch - TextBox

[elementID]: is like any variable will contain the current value

value: will be based on type

  • for Combo: value1|value2|value3
  • for Switch: 0 or 1 (Off - On)
  • for TextBox: any text content (empty value is possible)

tabName: will be used to group the elements in one tab (cannot be empty)

Hint: in case of Combo hint will be used as default value (hint will be ignored for Switch)


container: used to create container for form elements

COMMAND STRUCTURE:

container [containerID];, tabName1,tabName2,tabName3


form: used to create settings page

COMMAND STRUCTURE:

form [formID];, title;, [containerID];, button1;, button2

formID will return the pressed button's value

all form elements will update and save the values directly

form will by default save the structure as formID.frm in the $LocalFolder if you want to reset the elements, delete this file each time before calling the command

EXAMPLE:

element [textElement];, TextBox;,  ;, Test text box;, enter text;, General
element [switchElement];, Switch;, 0;, Test switch;, switch element;, General
element [ComboElement];, Combo;, First|Second|Third;, Test combo;, Second;, General
container [containerID];, General
form [formID];, Test Form;, [containerID];, Reset;, Close


Extra

clipboard: send custom text to clipbloard

COMMAND STRUCTURE:

clipboard title;, message;, text

title, message: used for the notification

text: the content you need to send to clipboard


rand: get random number between max and min value

COMMAND STRUCTURE:

rand [variableID];, min;, max

if any wrong value entered for min or max default values will be used

min (default): 0 max (default): 1000

rand command can be extended with seed option:

rand [variableID];, min;, max;, seed


psave: save value to app data

COMMAND STRUCTURE:

psave [variableID];, value


pget: get value from app data

COMMAND STRUCTURE:

pget [variableID];, default

default: will be returned in case the variable is not found in app data


premove: remove value from app data

COMMAND STRUCTURE:

premove [variableID]


zip: used to zip folder

COMMAND STRUCTURE:

zip [sourceID];, [targetID];, fileName

be sure that you have access to sourceID, targetID


unzip: used to zip folder

COMMAND STRUCTURE:

unzip [fileID];, [folderID]

be sure that you have access to folderID

progress is linked with this command and will show the current percentage


ocr: used extract text from images

COMMAND STRUCTURE:

ocr [outputID];, [fileID];, language

language should be in short format like: en, ar, ch, fr you can use only one language per command


speak: used to speak custom text

COMMAND STRUCTURE:

speak text;, gender

gender: male or female


speakf: used to save text speak to file

COMMAND STRUCTURE:

speakf text;, gender;, [fileID]

gender: male or female

use createf to generate file


speakr: used for SpeechRecognizer

COMMAND STRUCTURE: speakr [variableID];, filling

filling: like "Phone"..etc

THIS COMMAND NOT TESTED AND THERE IS NO SAMPLES FOR IT YET



GPIO

gopen: Opens a connection to I/O (GPIO) pin in exclusive mode

COMMAND STRUCTURE:

gopen [pinID];, pinNumber

For errors read: Click Here

To use specific open mode use |S with pinNumber to Opens the GPIO pin as shared, so that other connections in SharedReadOnly mode to the pin can be opened


gwrite: Drives the specified value onto the general purpose I/O (GPIO) pin according to the current drive mode for the pin if the pin is configured as an output, or updates the latched output value for the pin if the pin is configured as an input

COMMAND STRUCTURE:

gwrite [pinID];, state

state: 0 or 1 (Low - High)


gread: Reads the current value of the general-purpose I/O (GPIO) pin.

COMMAND STRUCTURE:

gread [outputID];, [pinID]

variableID: 0 or 1 (Low or High)


gclose: Closes the general-purpose I/O (GPIO) pin and releases the resources associated with it.

COMMAND STRUCTURE:

gclose [pinID]



Telnet

telnet: used to create new telnet client

COMMAND STRUCTURE:

telnet [telnetID];, hostIP;, hostPort

by default all non-commander commands will be sent to telnet so you can use this command so more advanced usage but not required


telnetp: used to create new telnet client with authentication

COMMAND STRUCTURE:

telnetp [telnetID];, hostIP;, hostPort;, user;, pass

by default all non-commander commands will be sent to telnet so you can use this command so more advanced usage but not required


send: used to send command using specific telnet client

COMMAND STRUCTURE:

send [telnetID];, (command)

As I said before these commands for specific usage and it's not required to execute command you can always write the telnet command 'as is' in the script


reconnect: used to re-generate the telnet client and connection

COMMAND STRUCTURE:

reconnect [telnetID]


close: used to close the telnet client connection

COMMAND STRUCTURE: close [telnetID]



Processes / Timers

process: used to create new process that can handle telnet commands

COMMAND STRUCTURE:

process [processID];, (command);, [telnetID]

command can be file as well like (run.bat)

this process will not start by default, look at start, stop commands below

if you want to use custom non-telnet command use 0 for telnetID

this command can deal with all commander commands

the script will wait until the process finish

(you can use it with task if you don't need to wait)


task: used to create new task that can handle specific process

COMMAND STRUCTURE:

task [taskID];, [processID]

this task will not start by default, look at start, stop commands below

call task when you need to execute command without waiting


timer: used to create new timer with specific process each 'x' time

COMMAND STRUCTURE:

timer [timerID];, [processID];, interval

this timer will not start by default, look at start, stop commands below

-it's important to stop the timer when the script done, or it will keep working even after the script finish

-all the timers that started by the current script will be stopped and removed once the script removed from the queue


start: used to start process, task or timer by specific ID

COMMAND STRUCTURE:

start [targetID]


stop: used to stop process, task or timer by specific ID

COMMAND STRUCTURE:

stop [targetID]


Events

onStart: will be called when process, task or timer started

COMMAND STRUCTURE:

onStart [targetID];, [processID]


onFinish: will be called when process, task or timer finished

COMMAND STRUCTURE:

onFinish [targetID];, [processID]


onClose: will be called when telnet connection closed for specific ID

COMMAND STRUCTURE:

onClose [telnetID];, [processID]



DLLs

load: this command used to load specific dll file to the memory

COMMAND STRUCTURE:

load [variableID];, dllFile

variableID will contain the pointer value

I don't know actual usage for this command but may help someone for advanced usage


unload: this command used to unload specific dll file from the memory

COMMAND STRUCTURE:

unload pointerValue;, [outputID]

outputID is a variable that will handle the unload state



Encoding

images2video: convert images to video - or convert video

COMMAND STRUCTURE:

images2video [folderID];, outputFile;, [imagesFolder];, imagesType;, options

options structure is:

framerate:value|bitrate:value|width:value|height:value|fps:value|audio:[fileID]

you don't have add all of them, just add what is required by your needs

if you have to use the param, you can set it to 'none' if it's not active

Note: it's prefered to use variable for the video name

so when the file exits the variable will updated to the new name

deloriginal:0

this option by defaul is 1 set it to 0 to prevent the script from remov the images folder

orderbyname:1

if you didn't assign orderbyname it will order the files by creation date

imagesize:1

if imagesize not added, will use the screen w/h or the custom values

matchfps:1

matchfps will use the exact FPS for the output video, framerate usually used to define how many clip per second and the output video by default will use auto fps

clipduration:1

value in 'seconds', default will be calucalted based on fps (Ex. 17/1000)

when you assign this param, each image will stay for x second

type:mp4

type used to define the output type (mp4 by default), can be:

mp4, avi, hevc, wmv, mp3, wav, flac, wma

stabilize:1

for videos only, will be ignored for images

zoom:value

adjust zoom level for all clips, value in float exam. 0.5

saturation:value

adjust saturation for all clips, value in float exam. 0.3

volume:value

adjust saturation for all clips, value in double exam. 0.3

(defaul is 1 lowset is 0.. any greater value than 1 will be like boost audio)

chroma:value

apply chroma key, value is the color name exam. green

set it to none if you want to use it in active

color value can be hexColor exam. #00FF00

value can be extended to chroma:color-tolerance-feather

tolerance: in float, exam. 0.1 (max 1.0)

feather: 1 or 0 (active or disabled)

background:value

add clip background, details will be later (NOT TESTED)

subtype:value

for subtype visit: Click Here

outputFile is the video name only (extension will added automaticly)

bitrate in kb like 3000

output will be MP4 video file (by default) unless you changed the type:.. param

if your [imagesFolder] inside the [folderID]

use the imagesFolderName|I insead of [imagesFolder]

you can add |F to the imagesFolder if you want to covert a video file instead of images (Direct file)

Mixed content images/video should be fine

imagesType can be mixed png|jpg|mp4

progress is linked by default with this command

End of the documentation All rights reserved to Bashar Astifan