Running the Designer via cmd
Running the Designer via cmd
Hi, I have a designer scenario in which I would like to run via a batch file. I am aware that there exists this command --play filename : plays the opened scenario (see also --no-session-management) which plays a scenario but my problem is that this scenario i would like to run has a "brainamp file reader box" in which I would like to pass the file as a parameter in the cmd, is it possible? Since I would like to run it automatically, each time using a different file .. can someone help, please?
-
- Posts: 775
- Joined: Tue Dec 04, 2012 3:53 pm
- Location: INRIA Rennes, FRANCE
Re: Running the Designer via cmd
Hi Dan,
you can do what you want by specifying the filename as a configuration token as follows,
and then instead of the actual file path, write ${myFile} to the box configuration. It will be expanded runtime.
Happy hacking,
Jussi
you can do what you want by specifying the filename as a configuration token as follows,
Code: Select all
openvibe-designer.cmd --define myFile C:/temp/some.file
Happy hacking,
Jussi
Re: Running the Designer via cmd
I tried the following command
openvibe-designer.cmd --play C:/Users/Daniela/Desktop/conf1.xml --define brainampFile C:/Users/Daniela/Desktop/recording/michael.vhdr
and the designer opens the scenario and starts but I get an error 'could not open file' but that file exists because when I input it manually in the box, it works, but for some reason, the cmd is reading the path as if there is a space in front and i get an error
[ ERROR ] <Algorithm::Brainamp file reader> Could not open file [ 'C:/Users/Daniela/Desktop/recording/michael.vhdr']
You see that space in front between [ and '? but if I do not do the space between the brainampFile and the path, I still get an error .. any ideas?
openvibe-designer.cmd --play C:/Users/Daniela/Desktop/conf1.xml --define brainampFile C:/Users/Daniela/Desktop/recording/michael.vhdr
and the designer opens the scenario and starts but I get an error 'could not open file' but that file exists because when I input it manually in the box, it works, but for some reason, the cmd is reading the path as if there is a space in front and i get an error
[ ERROR ] <Algorithm::Brainamp file reader> Could not open file [ 'C:/Users/Daniela/Desktop/recording/michael.vhdr']
You see that space in front between [ and '? but if I do not do the space between the brainampFile and the path, I still get an error .. any ideas?
-
- Posts: 775
- Joined: Tue Dec 04, 2012 3:53 pm
- Location: INRIA Rennes, FRANCE
Re: Running the Designer via cmd
The problem is not only the space, but the ' ' characters. Where are they coming from? The filename shouldn't have them in it. If you look at the configuration token you defined in the pulldown menu Preferences, does it have ' ' around it or no? If you need to handle filenames with spaces (this always leads to trouble), you should try the " " chars instead, but even they shouldn't be there in the final token as is expanded/shown by Designer.
Hope this helps,
Cheers,
Jussi
Hope this helps,
Cheers,
Jussi
Re: Running the Designer via cmd
You're right - I added the '' by mistake after pasting the error but without them, I still get the error. I guess the problem is the space but Im not sure what I am doing wrong?
[ ERROR ] <Algorithm::Brainamp file reader> Could not open file [ C:/Users/Daniela/Desktop/recording/michael.vhdr]
[ ERROR ] <Algorithm::Brainamp file reader> Could not open file [ C:/Users/Daniela/Desktop/recording/michael.vhdr]
-
- Posts: 775
- Joined: Tue Dec 04, 2012 3:53 pm
- Location: INRIA Rennes, FRANCE
Re: Running the Designer via cmd
I'm afraid I don't understand where this space comes from. Do you get it if you put the token to the message field of the 'Hello World' box or if you look at the tokens value in Preferences?
Re: Running the Designer via cmd
I found the problem!!! there was a space before ${brainampFile} !! It was too obvious to find
Re: Running the Designer via cmd
Dear Dan,
maybe you should use the equal sign between the token name and the token value as is defined in the configuration files :
if your file name has spaces or special characters, then you can use double brackets like in :
hope this helps,
Yann
maybe you should use the equal sign between the token name and the token value as is defined in the configuration files :
Code: Select all
--define myFile=C:/temp/some.file
Code: Select all
--define "myFile=C:/temp/some filename with spaces.file"
Yann
-
- Posts: 775
- Joined: Tue Dec 04, 2012 3:53 pm
- Location: INRIA Rennes, FRANCE
Re: Running the Designer via cmd
Hi Yann,
just a quick note about the separator: I couldn't get "=" to parse in all circumstances on Windows, so in the current mainstream openvibe the token and the value should be separated just by a space.
Cheers,
Jussi
just a quick note about the separator: I couldn't get "=" to parse in all circumstances on Windows, so in the current mainstream openvibe the token and the value should be separated just by a space.
Cheers,
Jussi