I plan to implement several different functions into a script that the user can choose from. Implementing a GUI is too slow for the user though, so the different functions should be assigned to different keystrokes. Until now I used the way to "encode" the needed script function into its filename (xx_1.js, xx_2.js, etc), which were identical copy of the same file. The script could then read its filename and decide about the needed functionality in a switch statement. The problem about this approach is tht you need to make many copies of the same file under different filenames, which is ugly (mainly if you still debug your program).
It would be very nice if you could assign the SAME script to SEVERAL keystrokes (using Preferences/Keyboard), and then within the script read out the actual keystroke the user chose to invoke the script and so differ between the operations. So my question is if there's a way to do that, some global variable (like ScriptFile) that the user could read to find out about it?
It would be very nice if you could assign the SAME script to SEVERAL keystrokes (using Preferences/Keyboard), and then within the script read out the actual keystroke the user chose to invoke the script and so differ between the operations. So my question is if there's a way to do that, some global variable (like ScriptFile) that the user could read to find out about it?