Make script using other scripts

Asked by DAVID MASTROIANNI on 2017-09-29

Let's say I have script1.sikuli, script2.sikuli, and script3. sikuli completed

How might I be able to run script1 then script 3 then script 1 then script 2 or any combination? example:

run sikuli.scipt1
run sikuli.scipt2
run sikuli.scipt3
run sikuli.scipt1
run sikuli.scipt2

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2017-09-30
Last reply:
2017-09-30

1) Using command line ( http://sikulix-2014.readthedocs.io/en/latest/faq/010-command-line.html )
2) Defining scripts as Python functions, and then running a combination

that is
=====
def script1():
    # Do something

def script2():
    # Do something

def script3():
    # Do something

script1()
script2()
script3()
script2()
script1()

=====

For more info look for Python functions ( https://www.tutorialspoint.com/python/python_functions.htm -- here, for instance)

That's for starters. If you need more advanced structure, you want to look into Python modules topic:
https://www.tutorialspoint.com/python/python_modules.htm

masuo (masuo-ohara) said : #2

Running scripts and snippets from within other scripts and run scripts one after the other
http://sikulix-2014.readthedocs.io/en/latest/scripting.html?highlight=runscript

runScript("C:\\script\\sikuli.scipt1")
runScript("C:\\script\\sikuli.scipt2")
runScript("C:\\script\\sikuli.scipt3")

masuo (masuo-ohara) said : #3

Sorry, I made a mistake in the folder name.

Running scripts and snippets from within other scripts and run scripts one after the other
http://sikulix-2014.readthedocs.io/en/latest/scripting.html?highlight=runscript

runScript("C:\\script\\scipt1.sikuli")
runScript("C:\\script\\scipt2.sikuli")
runScript("C:\\script\\scipt3.sikuli")

DAVID MASTROIANNI (dmastro918) said : #4

runScript(F:\Sikuli X\SWFC_ALT_1.sikuli)
___________________________________________________________
[error] script [ Untitled ] stopped with error in line 1 at column 11
[error] SyntaxError ( "no viable alternative at input ':'", )
====================================================
I want to make scripts, separately at first, then combine them into one script later.

Right now I have script1, script 2, and script3 and I combine them into script4 by copying and pasting the code from script1, then copy and paste code from script2, then copy and paste code from script3.

My issue here is that scripts12&3 will be changing, but I don't want to have to change script4 each time as well since it is just a combination of scripts 1, 2, and 3.

masuo (masuo-ohara) said : #6

@DAVID #4 comment

Is there quotation marks?

Can you help with this problem?

Provide an answer of your own, or ask DAVID MASTROIANNI for more information if necessary.

To post a message you must log in.