Execute Command

Post Reply
AndrewFriedman
Newbie
Posts: 3
Joined: Tue May 30, 2023 2:43 pm

Execute Command

Post by AndrewFriedman »

Hello,

So I have been trying to get the execute command to work for a little bit now and I can't seem to get it right. What I want to do is have my input files (PDF) gets put into the execute command that would trigger my script to run. My script will take the PDF files and string out parts of the text using OCR then lay it out on a json file. I was told to use arguments for my input and output folders ("%1" and "%3"). I also turned on my log and I can see that switch is executing the file path to my script (/Applications/MAMP/htdocs/Arg.py) along with the arguments but I still get output folders that don't have anything inside of them. I see that it's trying to execute something which is why I don't understand why I'm getting blank folders as the output. if anyone has any tips or tricks I can try to get this up and running that would be great!

Thank you
Attachments
Screen Shot 2023-11-09 at 10.31.30 AM.png
Screen Shot 2023-11-09 at 10.31.30 AM.png (88.38 KiB) Viewed 1273 times
Execute Command ScreenShots.zip
Here is my script
(213.45 KiB) Downloaded 32 times
User avatar
magnussandstrom
Advanced member
Posts: 289
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Execute Command

Post by magnussandstrom »

I would use the app 'Execute Command Friend' for this task.
AndrewFriedman
Newbie
Posts: 3
Joined: Tue May 30, 2023 2:43 pm

Re: Execute Command

Post by AndrewFriedman »

Is there any way to do this task with the execute command?
freddyp
Advanced member
Posts: 957
Joined: Thu Feb 09, 2012 3:53 pm

Re: Execute Command

Post by freddyp »

There is a flaw in the setup of "Execute command". You have to consider that "Execute command" is like running a command on the command line (Terminal or Command prompt). If you were to type the path of the Python script the operating system would also complain. You have to run Python and the script is one of the parameters. Likewise in "Execute command" "Command or path" has to point to Python and the script path goes into the "Arguments".
User avatar
magnussandstrom
Advanced member
Posts: 289
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Execute Command

Post by magnussandstrom »

I found an old flow where I executed a Python script with Execute command, here are my settings:

python.png
python.png (38.04 KiB) Viewed 1195 times

Arguments on this case are:

Code: Select all

C:\Users\color\Documents\image-background-remove-tool\main.py -i "%1" -o "%3\[Job.NameProper].png" -m u2net
AndrewFriedman
Newbie
Posts: 3
Joined: Tue May 30, 2023 2:43 pm

Re: Execute Command

Post by AndrewFriedman »

Hello,

So I changed a few things but I don't think that my script is being run. I set up a test that should change the text in the output file when the script is running but I don't see any changes which is why I'm assuming that my script is not being run. Looking at the logs I noticed that there are quotation marks that are being added to the path that leads to my script. I don't know if this is a switch thing or what is happening. Is there something that I'm missing?
Attachments
Screen Shot 2023-11-28 at 12.41.01 PM.png
Screen Shot 2023-11-28 at 12.41.01 PM.png (46.93 KiB) Viewed 1039 times
Screen Shot 2023-11-28 at 12.41.40 PM.png
Screen Shot 2023-11-28 at 12.41.40 PM.png (6.76 KiB) Viewed 1039 times
Post Reply