User Tools

Site Tools


manual:Variables

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
manual:Variables [2019/06/18 01:33]
peternlewis
manual:Variables [2019/09/12 19:32]
JMichaelTX Add comment about case sensitivity
Line 11: Line 11:
  
 ^ Scope ^ Availability ^ ^ Scope ^ Availability ^
-| **Global**, Permanent variables | • Accessible basically everywhere, including Scripts.\\ • You can also see and edit variables in the Preferences.\\ • You can see global variables in the [[manual:​Value_Inspector|Value Inspector]]. |+| **Global**, Permanent variables | • Accessible basically everywhere, including Scripts.\\ • You can also see and edit variables in the Preferences.\\ • You can see global variables in the [[Windows#​Value_Inspector_Window ​|Value Inspector]]. |
 | **Password**,​ Semi-permanent variables | • Available to macros but not displayed.\\ • Not directly accessible via AppleScript.\\ • Concealed in password fields in Prompt For User Input actions.\\ • Not saved to disk. | | **Password**,​ Semi-permanent variables | • Available to macros but not displayed.\\ • Not directly accessible via AppleScript.\\ • Concealed in password fields in Prompt For User Input actions.\\ • Not saved to disk. |
 | **Instance** Variables (v8+) | • Restricted ​ to a specific execution sequence.\\ • Available to the Macro where it was created and Sub-Macros of that Macro, for a given execution instance of the main macro.\\ • These Variables are private to each execution of the same Macro, even when running simultaneously.\\ • Accessible by [[action:​Prompt_for_User_Input|Prompt For User Input]]\\ • As of v8.0.3, is accessible by scripts (when used in an Execute Script Action).\\ • Accessible by [[action:​Custom_HTML_Prompt|Custom HTML Prompt]] (v8.0.3+).\\ • Accessible by AppleScript with the instance specifier. | | **Instance** Variables (v8+) | • Restricted ​ to a specific execution sequence.\\ • Available to the Macro where it was created and Sub-Macros of that Macro, for a given execution instance of the main macro.\\ • These Variables are private to each execution of the same Macro, even when running simultaneously.\\ • Accessible by [[action:​Prompt_for_User_Input|Prompt For User Input]]\\ • As of v8.0.3, is accessible by scripts (when used in an Execute Script Action).\\ • Accessible by [[action:​Custom_HTML_Prompt|Custom HTML Prompt]] (v8.0.3+).\\ • Accessible by AppleScript with the instance specifier. |
Line 37: Line 37:
 ==== Instance Variables (v8+) ==== ==== Instance Variables (v8+) ====
  
-Variables with names that start with "​Instance"​ (trailing space not necessary) are considered private to a specific execution sequence. ​ Each time the macro is run, they will start empty but their value can be seen and changed by other macros within the same execution sequence (for example, if you execute a macro using the [[action:​Execute_a_Macro|Execute Macro]] action, that macro can see and change the instance variable). ​ Since two instances of a macro can be running at the same time, this is useful to ensure they each have their own version of the variable.+Variables with names that start with "​Instance"​ (case insensitive, ​trailing space not necessary) are considered private to a specific execution sequence. ​ Each time the macro is run, they will start empty but their value can be seen and changed by other macros within the same execution sequence (for example, if you execute a macro using the [[action:​Execute_a_Macro|Execute Macro]] action, that macro can see and change the instance variable). ​ Since two instances of a macro can be running at the same time, this is useful to ensure they each have their own version of the variable.
  
 Since Local and Instance variables are transient, they are not shown in the [[manual:​Preferences#​Variables_Preferences| Variables preferences pane]]. Since Local and Instance variables are transient, they are not shown in the [[manual:​Preferences#​Variables_Preferences| Variables preferences pane]].
Line 44: Line 44:
 ==== Local Variables (v8+) ==== ==== Local Variables (v8+) ====
  
-Variables with names that start with "​Local"​ (trailing space not necessary) are considered local to a specific execution of a specific macro. ​ Each time the macro is run, they will start empty and no other macro will see or be able to change values.+Variables with names that start with "​Local"​ (case insensitive, ​trailing space not necessary) are considered local to a specific execution of a specific macro. ​ Each time the macro is run, they will start empty and no other macro will see or be able to change values.
  
 **Note that //Local// and //​Instance//​ Variables are available in scripts //only// when the script is called in an //Execute Script// action, ** unless you specify the execution instance explicitly. **Note that //Local// and //​Instance//​ Variables are available in scripts //only// when the script is called in an //Execute Script// action, ** unless you specify the execution instance explicitly.
Line 181: Line 181:
 ===== Watching a Variable’s Value ===== ===== Watching a Variable’s Value =====
  
-You can use the [[manual:​Value_Inspector|Value Inspector]] to watch the value of a global variable.+You can use the [[Windows#​Value_Inspector_Window ​|Value Inspector]] to watch the value of a global variable.
  
manual/Variables.txt · Last modified: 2023/09/29 04:44 by peternlewis