Closed MohrJonas closed 2 years ago
Yes there is. If you have a shortcut that has no Test string, then it's what is called a "helper script". A helper script's Expansion string is prepended to the Expansion strings of all shortcuts defined after it. Thus, you could put toCamelCase() inside a helper script shortcut, and then call it in any shortcuts defined below the helper script.
Helper scripts are limited to within the shortcut-file (or the list of shortcuts within the plugin's settings). Thus, you can't define a helper script in shortcut-file A, then use it in shortcut-file B. Instead, you'd have to rewrite it in shortcut-file B.
You can read more about helper scripts here.
Let's say I have a function toCamelCase() that takes a string as input and returns it in camelCase. I now want to use this function inside multiple shortcuts. Is there a way to define global functions for use in multiple shortcuts (Basically a kind of import)? Thanks.