Bug/Request Need a true "Pre batch script"
The current "Pre batch script" is not a pre batch script!
That is, it does not run before all the (other) methods in a batch.
Rather all the methods before the script run through all of the files, then the "Pre batch script" FOR THAT STEP runs, then the main script loops through the files -- for that step**.
Admittedly, this can be useful once a user figures out that that is what is happening.
But it's misleading and Computation/time costs jump, potentially exponentially.
But the real problem is that we can't do something like:
function bigCasino (foo) { /* really expensive stuff here*/ }
in a Universal pre-batch and have it available to all the separate script methods in a batch.
==> Please provide a Universal pre-batch where we can define variables/functions available to more than one script method in the batch.
==> Rename the current "Pre batch script" to "Pre step Loop" or similar -- or at least document the behavior of this code on the help page.
~~~~~
** Is the program looping the files O(n), or more, separately for each method in a batch? (Not a criticism, just useful to know when planning large tasks)
That is, it does not run before all the (other) methods in a batch.
Rather all the methods before the script run through all of the files, then the "Pre batch script" FOR THAT STEP runs, then the main script loops through the files -- for that step**.
Admittedly, this can be useful once a user figures out that that is what is happening.
But it's misleading and Computation/time costs jump, potentially exponentially.
But the real problem is that we can't do something like:
function bigCasino (foo) { /* really expensive stuff here*/ }
in a Universal pre-batch and have it available to all the separate script methods in a batch.
==> Please provide a Universal pre-batch where we can define variables/functions available to more than one script method in the batch.
==> Rename the current "Pre batch script" to "Pre step Loop" or similar -- or at least document the behavior of this code on the help page.
~~~~~
** Is the program looping the files O(n), or more, separately for each method in a batch? (Not a criticism, just useful to know when planning large tasks)
Reply to #1:
Hi Randy,
I've been thinking, and occasionally saying, that I'd like to see a system for incorporating #include files in batch scripts. A #global_include capability would do what you are saying and do what I would like: write once, use any time for files that contain "stock" user-defined functions/methods/whatever.
What do you think? Dream big, am I right? :)
Best,
DF
Hi Randy,
I've been thinking, and occasionally saying, that I'd like to see a system for incorporating #include files in batch scripts. A #global_include capability would do what you are saying and do what I would like: write once, use any time for files that contain "stock" user-defined functions/methods/whatever.
What do you think? Dream big, am I right? :)
Best,
DF
Reply to #2:
Thanks DF,
Yes, that would be a nice feature to have also.
Thanks DF,
Yes, that would be a nice feature to have also.
Reply to #3:
While we're on requests, Kim, could you add a checkbox in Settings to allow scripts to be active without having to check each one every time they are loaded? I only use my own scripts, and I load multiple methods with scripts every day, so it would make my life *much* easier. I assume there are some others that would like that, and it seems like something that wouldn't be difficult to implement (although I could of course be wrong and, if so, ignore it).
Thanks and best,
DF
While we're on requests, Kim, could you add a checkbox in Settings to allow scripts to be active without having to check each one every time they are loaded? I only use my own scripts, and I load multiple methods with scripts every day, so it would make my life *much* easier. I assume there are some others that would like that, and it seems like something that wouldn't be difficult to implement (although I could of course be wrong and, if so, ignore it).
Thanks and best,
DF
Reply to #4:
Hi DF,
I'm confused as I don't see the problem. Does clearing the:
Settings -> JS Script editor -> Confirmation when loading script from method list file
checkbox not do this for you?
Or is something else going on?
Regards,
Randy
Hi DF,
I'm confused as I don't see the problem. Does clearing the:
Settings -> JS Script editor -> Confirmation when loading script from method list file
checkbox not do this for you?
Or is something else going on?
Regards,
Randy
Reply to #5:
R,
If checked I get a popup asking if I want to load the script. If unchecked the script methods load automagically, but they are not enabled. I have to check the activate box on the method header.
Am I doing something wrong? Or is my screwy system phaffing me yet again?
Best,
DF
R,
If checked I get a popup asking if I want to load the script. If unchecked the script methods load automagically, but they are not enabled. I have to check the activate box on the method header.
Am I doing something wrong? Or is my screwy system phaffing me yet again?
Best,
DF
Reply to #6:
I don't have that problem. Perhaps save the batches afresh after the checkboxes are checked?
If that doesn't work then yeah, maybe you need an uninstall - reboot - reinstall cycle?
Good Luck,
Randy
I don't have that problem. Perhaps save the batches afresh after the checkboxes are checked?
If that doesn't work then yeah, maybe you need an uninstall - reboot - reinstall cycle?
Good Luck,
Randy
Reply to #7:
OK, I'm an idiot. I never *actually* read the popup. Turns out I had to check a pesky little box that says "load active" or some such. Problem solved.
Take me seriously at your own peril! :)
OK, I'm an idiot. I never *actually* read the popup. Turns out I had to check a pesky little box that says "load active" or some such. Problem solved.
Take me seriously at your own peril! :)
Reply to #1:
The "Pre batch script" is a script that will be executed before the script executes the file loop. Is is still being processed in method list order. Executing the script before any other method in the list would be misleading.
If you have multiple script methods, they are separate from one another. A method defined in one is not available in another.
I think you are touching some rare edge cases here. It is not very common to use multiple script methods.
The "Pre batch script" is a script that will be executed before the script executes the file loop. Is is still being processed in method list order. Executing the script before any other method in the list would be misleading.
If you have multiple script methods, they are separate from one another. A method defined in one is not available in another.
I think you are touching some rare edge cases here. It is not very common to use multiple script methods.
Reply to #9:
Yes, it probably is an edge case, with only two power users asking for it on this forum. (By the ten-to-one rule, that's at least 20 users overall.)
And I can begrudgingly work around it. It just requires a lot of copy and paste coding which goes against bedrock principles of good programming.
See: https://medium.com/@curiousraj/the-principles-of-clean-code- dry-kiss-and-yagni-f973aa95fc4d
etc.
Yes, it probably is an edge case, with only two power users asking for it on this forum. (By the ten-to-one rule, that's at least 20 users overall.)
And I can begrudgingly work around it. It just requires a lot of copy and paste coding which goes against bedrock principles of good programming.
See: https://medium.com/@curiousraj/the-principles-of-clean-code- dry-kiss-and-yagni-f973aa95fc4d
etc.