Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Run script when Apps List is loaded

#1
Hi There,

I had a question about the app loader settings in Robodk. There is one setting, the RunCommands, that I'm interested in. The documentation says that its value is a 'string with commands to execute when the tool bar is loaded'. Is it possible to execute a custom command (or python file) from this setting? Would I need to set this value to the name of the file (I.e. RunCommands = MyPythonFile.py).

Brad
#2
The commands you can provide in RunCommands are any commands supported by RoboDK through the command line option. You'll find more information about RoboDK commands here:
https://robodk.com/doc/en/RoboDK-API.html#CommandLine

You can also find a list of useful commands here (commands can also be provided using the API after startup):
https://robodk.com/doc/en/PythonAPI/robo...nk.Command

We actually support more commands than the ones you'll find documented. For example, if you want to run Python code you can inline the code using:
Code:
RunCommands="PythonRunCode=from robolink import *<br>RDK=Robolink()<br>RDK.ShowMessage('Hello world')"

New lines can be represented as <br> tags.

This would be the equivalent call using the Comman function of the API:
Code:
from robolink import *
RDK = Robolink()
RDK.Command("PythonRunCode","from robolink import *<br>RDK=Robolink()<br>RDK.ShowMessage('Hello world')")

The App loader plugin is open source and can be customized. If you find ways to improve it we can add your suggested improvements to the official release.

If you can provide us with more information about what you are trying to do we may be able to help you better.
#3
Hi Albert, thanks for the information. I tried to use the command you provided, but it seems that only the command name is functioning and not the command value. For example, I tried to run a simple RunCommands="AddFolder=NewFolder" command and this did not work with the app loader. Is it possible that the app loader does not accept command values? Is there another way to assign the command value to the command besides the equal sign?
  




Users browsing this thread:
1 Guest(s)