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
State Corporate Income Tax Rates and Brackets for 2024
Robinsons Supermarket
Jail Inquiry | Polk County Sheriff's Office
neither of the twins was arrested,传说中的800句记7000词
#ridwork guides | fountainpenguin
Windcrest Little League Baseball
What to Serve with Lasagna (80+ side dishes and wine pairings)
Do you need a masters to work in private equity?
Wal-Mart 140 Supercenter Products
Crazybowie_15 tit*
Dark Souls 2 Soft Cap
A Fashion Lover's Guide To Copenhagen
Danielle Longet
Hmr Properties
Oscar Nominated Brings Winning Profile to the Kentucky Turf Cup
Builders Best Do It Center
Rhinotimes
Les Schwab Product Code Lookup
Nene25 Sports
Byte Delta Dental
10-Day Weather Forecast for Florence, AL - The Weather Channel | weather.com
Zalog Forum
Full Standard Operating Guideline Manual | Springfield, MO
Ratchet & Clank Future: Tools of Destruction
Somewhere In Queens Showtimes Near The Maple Theater
Exl8000 Generator Battery
R&S Auto Lockridge Iowa
European city that's best to visit from the UK by train has amazing beer
Ecampus Scps Login
Inbanithi Age
Sam's Club Gas Price Hilliard
Finding Safety Data Sheets
TJ Maxx‘s Top 12 Competitors: An Expert Analysis - Marketing Scoop
Ugly Daughter From Grown Ups
Pch Sunken Treasures
Walter King Tut Johnson Sentenced
Marine Forecast Sandy Hook To Manasquan Inlet
Collier Urgent Care Park Shore
Michael Jordan: A timeline of the NBA legend
Joey Gentile Lpsg
11301 Lakeline Blvd Parkline Plaza Ctr Ste 150
2023 Fantasy Football Draft Guide: Rankings, cheat sheets and analysis
'Guys, you're just gonna have to deal with it': Ja Rule on women dominating modern rap, the lyrics he's 'ashamed' of, Ashanti, and his long-awaited comeback
Locate phone number
Flappy Bird Cool Math Games
Autozone Battery Hold Down
Senior Houses For Sale Near Me
Congruent Triangles Coloring Activity Dinosaur Answer Key
The Quiet Girl Showtimes Near Landmark Plaza Frontenac
Blippi Park Carlsbad
Every Type of Sentinel in the Marvel Universe
Wayward Carbuncle Location
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.