Hi,
I try to start a program and I need to use a parameter containing quote mark (because there is a space in the path)
for example
program.exe -path-to-config="c:\project\project 1\project.prj"
Unfortunately, I saw that the quotes are not parsed when using them in the parameters field and therefore my program loads without the config.
Anyone knows how to force Actiona to parse the quotes when used in the parameters?
Thanks,
Dan
parameter with quote mark
Re: parameter with quote mark
Sometimes I just call from Actiona command a python wrapper script which uses subprocess
to allow long commands, with multiple args, to be invoked.
Have you tried single quotes?
to allow long commands, with multiple args, to be invoked.
Have you tried single quotes?
Re: parameter with quote mark
Yes, I have tried single quotes. It doesn't work... I also tried to escape using \, also no success
Re: parameter with quote mark
This is an example of what I have in mind.
Write python wrapper script .. command.py .. and save in same directory as your *.ascr script.
[command.py]
Test that the python script works on its own.
Then inside Actiona you can simply write path to the python script ..
Other than this idea does the Actiona command work if you use “project_1” instead of “project 1” .. i.e. drop spaces in path?
Write python wrapper script .. command.py .. and save in same directory as your *.ascr script.
[command.py]
Code: Select all
#!/usr/bin/env python
import subprocess
def runcmd():
p = subprocess.Popen(["program.exe", "-path-to-config='c:\project\project 1\project.prj' "], stdout=subprocess.PIPE)
print p.communicate()[0]
if __name__ == "__main__":
runcmd()
Code: Select all
python command.py
Code: Select all
Command: python
Parameters: command.py
Re: parameter with quote mark
thanks eureka for answering.
some thoughts:
1. usually the parameter is in a variable - would the python wrapper work also in this case?
2. transforming a path to have it without space is not an option. And yes, when there are no spaces, the Actiona script works.
I have tested also with the fart.exe ( Find and Replace Text) program and it also doesn't work, for example when using:
program: fart.exe
parameters: -C text_to_replace "replacement text"
some thoughts:
1. usually the parameter is in a variable - would the python wrapper work also in this case?
2. transforming a path to have it without space is not an option. And yes, when there are no spaces, the Actiona script works.
I have tested also with the fart.exe ( Find and Replace Text) program and it also doesn't work, for example when using:
program: fart.exe
parameters: -C text_to_replace "replacement text"
Re: parameter with quote mark
Windows is not my main OS (I have dual boot Ubuntu+Windows) so I'm a bit rusty on escaping paths in Windows.
Reading further, would this work ..
or this ..
Reading further, would this work ..
Code: Select all
program.exe -path-to-config="c:\project\'project 1'\project.prj"
Code: Select all
program.exe -path-to-config="c:\project\projec~1\project.prj"
Re: parameter with quote mark
Hi eureka,
many thanks for the hint - it worked with projec~1. On the other hand, putting the path with space between the single quotes did not work.
However, since I will (later) also need to find and replace some text (using fart.exe) or any other similar utility, I would definitely need to use the double quotes, so I still need some solution for using them in the parameter field.
Anyway, at least I have managed to start the program with the help of your hint.
many thanks for the hint - it worked with projec~1. On the other hand, putting the path with space between the single quotes did not work.
However, since I will (later) also need to find and replace some text (using fart.exe) or any other similar utility, I would definitely need to use the double quotes, so I still need some solution for using them in the parameter field.
Anyway, at least I have managed to start the program with the help of your hint.