In the Keyboard Maestro Preferences > Variables all of my global variables are grouped, first by me (js), then by macro. It's highly unlikely that my global variables will collide with variables from another macro. For example, suppose this macro was mine, I would name the global variable: jsSEP_SearchWebsitesįor global variables used in Prompt For User Input dialogs, since, when rendering a dialog, the Keyboard Maestro engine automatically excludes any prefix that includes two underscores. Js XXX_ YYYY where: 1) js are my initials 2) XXX is a short acronym or abbreviation for the macro 3) YYYY is a description for the variable. However, when I do use a global variable, I name them as follows: I find that the underscores also serve to make the variables easier to read.įor global variables and dictionaries, I also have conventions: Naming Global Variables and Dictionariesįor persistent data, I've generally moved away from storing persistent information in global variables in favor of dictionaries. That helps me easily identify the two groups. I use a lowercase local with two underscores for variables that are used in Prompt For User Input dialogs since, when rendering a dialog, the Keyboard Maestro engine automatically excludes any prefix that includes two underscores.īut for all other local variables I use one underscore. Hi thanks for sharing your naming conventions. I always put the two underscores before the name part of the Variable: Just while we're on the subject of good standard practice. This macro may be of no use for anyone that has Typinator or TextExpander, but for those that don't, it can save a lot of keystrokes.īTW, this topic came up during a recent Automators podcast. If you are interested in this macro, it's available here: Augment or Filter TextĪs the name implies, it's more general purpose (and can be configured), but the three expansions mentioned above are configured out of the box. All Mac automators need to check out Brett's site.) I think I first heard about this from Brett Terpstra: A Hyper Key with Karabiner Elements, full instructions. Many people using Karabiner-Elements to remap their Caps Lock key to ⌃⌥⇧⌘. (For those not familiar with Hyper, that's short for ⌃⌥⇧⌘. press Hyper+v, Hyper+w, or Hyper+x, respectively.Hi Like I always use the longer form: %Variable%local_MyVar%Īlso, during development and debugging I often use the following in Display Text ( display text in a window) actions: local_MyVar : I hope that clarifies things for you a bit. Personally, I always use the longer form, %Variable%user_input% even though it means more typing! It is up to you which form you use, though. Several KM experts in this forum have said that it is always best to keep potential confusion at a minimum and make sure that when you want to get the value of one of your variables you use the full form which is %Variable%user_input% Well, as you know KM provides many in-built text Tokens such as %SafariURL% and %TriggerValue% and %UserName% - see the whole list of them in the KM wikiīecause of this, it would be easy to confuse your use of the variable token %user_input% with a KM text token - simply because of the way they look similar. You should always use the form %Variable%user_input% instead. The alternative answer is this: you should never use %user_input% to get the value of your variable. ( IMPORTANT: you must capitalise the " V" in " Variable".) In other words, they both produce the exact same result: the value of the variable in question. Hi - the direct answer to your question is you can use %user_input% and %Variable%user_input% interchangeably.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |