Page 1 of 1
Running an exe directly from sequencer
Posted: Tue Aug 24, 2021 3:49 am
by zerolatitude
Idea is to start apps not natively supported in SC (eg Metaguide, MGDither, CdC etc) as part of a sequence.
I am currently doing this through a python script. i.e., use sequencer step "Run the python script in <script>" where the <script> has code to start an exe file.
Can it be done directly, that is, a sequencer step like "Run executable <filepathname>" ?
If not, any possibility of incorporating as a new sequencer step?
Thanks
Re: Running an exe directly from sequencer
Posted: Tue Aug 24, 2021 3:53 pm
by admin
Hi,
yes, this is in the 'Misc' section - 'Run <program to run> with arguments ...' - you can also specify whether the sequencer should wait for the program to exit or leave it running and carry on with other steps.
cheers,
Robin
Re: Running an exe directly from sequencer
Posted: Tue Aug 24, 2021 7:02 pm
by zerolatitude
So it is. Now how did I miss that?
Thanks.
Re: Running an exe directly from sequencer
Posted: Thu Oct 19, 2023 8:30 pm
by cveillet
I am trying to use this "Run" command from the sequencer, but I am clearly missing something, as it does not work the way I thought it would be working...
I want to launch a script processing the data from a rapid burst of very short images once the sequence is done (a lot of data processing done mostly in python). For now, I am launching just a basic script to test if it works... Data processing has been already tested in stand alone mode.
I assume for now that the script will be launched from the PowerShell (though I have also a version using a PowerShell bash command to launch a Linux version, the latter working also directly from an Ubuntu window).
Options of the Run "Select Step Properties"
Program to run: C:\Data\RINGSS\python_code\test.ps1
Arguments: 2023-10-17 Vega
Feedback:
An error occurred trying to start process 'C:\Data\RINGSS\python_code\test.ps1' with working directory 'C:\Users\cveil\Downloads'. The specified executable is not a valid application for this OS platform.' while running step Run 'C:\Data\RINGSS\python_code\test.ps1' with parameters '2023-10-17 Vega' and wait for it to exit
12:41:25 PM End : Sequence halted due to error.
Thanks for any advice! SharpCap is great, especially the sequencer! I am for now stuck with not knowing how to make this "Run" step work...
Cheers from AZ,
Christian
Re: Running an exe directly from sequencer
Posted: Fri Oct 20, 2023 12:27 pm
by admin
Hi Christian,
from the text of the error message, I suspect that Windows is being reluctant to run the .ps1 file as a script. Probably the trick to fix this will be to actually change the step to run Powershell.exe directly - something like
Code: Select all
powershell -ep bypass C:\Data\RINGSS\python_code\test.ps1
The -ep bypass option stops Powershell from getting upset about being asked to run a script from file - may or may not be necessary.
cheers,
Robin
Re: Running an exe directly from sequencer
Posted: Fri Oct 20, 2023 3:33 pm
by cveillet
Thanks, Robin. It works!
Code: Select all
RUN powershell WITH PARAMS "-ep bypass C:\Data\RINGSS\python_code\test.ps1 2023-10-17 Vega" WAIT True
It actually works with and without the -ep bypass option, so I'll just go without it.
Cheers!