JSON Syntax for Passing Parameters to Scripts (2024)

The JavaScript Object Notation (JSON) syntax contains a list of objects in brackets, colon separated with a key-value format.

Values can be:

  • Boolean, integer, real, floating point, strings in double quotes ("")
  • Array: ordered list of values, colon separated in square brackets ([])
  • Associative array : array in square brackets ([]) whose elements can be key-value couples, colon separated in curly brackets ({})
  • null

Note that it is possible to pass only one JSON whose proprieties are considered separated parameters. If deeper levels are available (as in the case of associative arrays) even though those levels are allowed, they are not considered parameters for the script.

The names of the parameters specified in the script may or may not be the same as those provided to the user. It the names are the same, they can be sorted differently from what specified in the script. If the names are not the same, they are sorted as provided to the user.

Examples

//The script is executed with a parameter, let's say "input"

read(input, "value")

If the script is invoked passing the object "System1:View:View.object" as parameter, the read operation (as defined in the script) is executed on the object provided. If you change the parameter, you change the object on which the operation will be executed.

//The script is executed with a parameter, let's say "choice"

if (choice === "read") {

read(...)

}

else if (choice === "execute") {

executeCommand(....)

}

If the script is invoked by passing the "read" string, the read operation will be executed; if the "execute" string is passed, a command will be executed.

console("a: " + a + "; b: " + b);

parameter specified

{ "a": "value of a", "b": "value of b" }

This script will write in the Console expander the following string: a: value of a; b: value of b. The output in the Console expander is the same also with shuffled inputs. If the keys defined in the JSON do not match with the parameters names, the parameters will be provided in ordinal sorts. See the following example:

console("a: " + a + "; b: " + b);

parameter specified

{ "b": "value of b", "a": "value of a" }

For the JSON input { "b": "value of b", "a": "value of a" } the output in the Console expander is: c: value of b; d: value of a.

...

//Do Something

...

//parameter specified

{

"a": "value of a",

"b": [

{"c": "value of c"},

{"d": "value of d"}

]

}

//that is

{ "a": "value of a", "b": [{"c": "value of c"}, {"d": "value of d"}]}

In the above example, only one JSON is passed as parameter (The Script Engine considers a and b as separate parameters. Furthermore, b contains an array, which means that it is possible to use b.c construct in the script with value c while construct b.d with value d.

JSON Syntax for Passing Parameters to Scripts (2024)
Top Articles
WUCare
Is Living on a Farm Worth It? Pros and Cons
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
How To Cut Eelgrass Grounded
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Dmv In Anoka
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Umn Biology
Obituaries, 2001 | El Paso County, TXGenWeb
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Colin Donnell Lpsg
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Electric Toothbrush Feature Crossword
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Used Curio Cabinets For Sale Near Me
San Pedro Sula To Miami Google Flights
Selly Medaline
Latest Posts
Article information

Author: Terence Hammes MD

Last Updated:

Views: 5964

Rating: 4.9 / 5 (69 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Terence Hammes MD

Birthday: 1992-04-11

Address: Suite 408 9446 Mercy Mews, West Roxie, CT 04904

Phone: +50312511349175

Job: Product Consulting Liaison

Hobby: Jogging, Motor sports, Nordic skating, Jigsaw puzzles, Bird watching, Nordic skating, Sculpting

Introduction: My name is Terence Hammes MD, I am a inexpensive, energetic, jolly, faithful, cheerful, proud, rich person who loves writing and wants to share my knowledge and understanding with you.