This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Run script
#1
Hi,

I would like to be able to force the execution of a Scheduled Script, is there a solution for that ?

If blablabla then
  Scheduled_script > run
end

BR
Jean-Marc
Jean-Marc
Reply
#2
script.enable(Script_Name)

and

script.disable(Script_Name)
Reply
#3
enable does not execute the scheduled script. One solution is to create a user library and move your code there. Then run it by calling require from scheduled and any other script. Make sure that auto load is disabled for this library.
Reply
#4
(14.04.2020, 08:51)admin Wrote: enable does not execute the scheduled script. One solution is to create a user library and move your code there. Then run it by calling require from scheduled and any other script. Make sure that auto load is disabled for this library.
Thanks admin.
This is what I am currently doing but it does not exactly meet my needs...
Jean-Marc
Reply
#5
Can you explain why this solution doesn't fit your needs?
Reply
#6
(14.04.2020, 10:19)admin Wrote: Can you explain why this solution doesn't fit your needs?
Sorry, I confused Common function and user library

Can you tell me what is the procedure to call a user script from other script ?

Jean-Marc
Jean-Marc
Reply
#7
Just use require('user.user_lib_name') in your code. Keep in mind that if you require the same library multiple times it will be executed only the first time. If you need to call it multiple times then you need to wrap your code into a function and then call this function. It's also good practice to use local variables in your library otherwise variables with same name in your main script will be overwritten.
Reply
#8
(14.04.2020, 15:26)admin Wrote: Just use require('user.user_lib_name') in your code. Keep in mind that if you require the same library multiple times it will be executed only the first time. If you need to call it multiple times then you need to wrap your code into a function and then call this function. It's also good practice to use local variables in your library otherwise variables with same name in your main script will be overwritten.
Thanks Admin ! Good.
Jean-Marc
Reply


Forum Jump: