You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is another nuance that I thought about tweaking initially, but then realized that
a. Currently the only way to introduce custom functions is to take advantage of this. Something like
do_something_in_hotkey()
return
function ...
if we did do this, we should probably also add a sandbox option to the main category (in addition to hotkey and hotstring) so that there is still a way to do this (and now we're moving away from primary focus on being simple and easy to get off the ground with AHK using this).
b. Anyone that does expect it to just put the code that they put would be annoyed
although I can't say with certainty that this is a larger group than those that want it to do more like you are suggesting (and would also like it to validate hotkeys and such).
So I don't think that automatically wrapping in new lines and return statements is a good idea, unless we went the whole way and provided the main sandbox, and only:
provided the starting new line if:
the provided code has new lines but does not start with a new line and does not have a return
provide the return if:
the provided code has new lines but does not have a return somewhere in it.
I had thought a while back about setting up a downstream version with more features available at something like https://advanced.ahkgen.com - I would rather do this in that context, keeping the original focused on helping newcomers get up and going (people I don't expect to be using sandbox features).
With this additional information, where do you stand?
Short description
If you enter custom code consisting of more than one line, the initial EOL and the final 'return' should be added automatically, if not present.
Detailed description
For example, generating the current timestamp in a way it can be used in filenames with the shortcut Ctrl-Win-e have to look like this in AHK:
If I only put
in the custom code field, it won't work, even if I append the line with 'return'.
There must be an initial EOL after the shortcut and before the code.
It would be great if this initial EOL and the return would added, if they don't exist.
The text was updated successfully, but these errors were encountered: