Re: Pre-execution Code
Posted: 30 Nov 2017, 19:17
It's a matter of degree.A_User wrote:It does not sound portable.
Library files can be included with the script (using the "local library"), and do not require overwriting global configuration which affects all scripts. Generally, if a library is missed, the program will tell the user that a library is missing, and the script will not run at all. Missing lines in an auto-include will not be so clear. (I believe Nextron already addressed this.)If one of them is missed, the script won't run properly, which is not actually fully portable.
Copying library scripts into a Lib folder is easier and much less likely to cause conflicts than editing a global configuration or auto-include file. Depending on how the script is packaged, the user may not need to do anything specifically for the libraries.The same applies to library scripts.
I think you are saying that the script author should distribute the configuration file with their script, but I think you are missing the point.If this suggested feature uses a configuration file, what are in effect will be all written in the configuration file. Or if this suggested feature uses a reserved library file name, what are in effert will be all in that file.The author may not even remember that they are in effect, in which case the user has little chance of replicating them. If these auto-includes are common to all scripts, a user wanting to use multiple scripts with conflicting requirements would be required to modify the script.
This is a fault of script authors or the lack of a central library repository. The design of libraries encourages modularity, whereas your global configuration file suggestion encourages conflicts. Many authors of libraries tend to avoid changing global settings (or limit the scope of change to their own functions). If any global changes are made, they only affect scripts which use that library.It's already happening with libraries.
It's a matter of degree.I'm just telling you that it's already happening and I see no different than what you predict for the suggested feature.
It was reasonable to assume you were talking about a larger majority of users, who use scripts they find on the forum. Now I suppose you meant users of AutoHotkey vs. users of programs written with AutoHotkey. For the second type, none of this matters.This type of user is the latter type I mentioned.