Passing switch variable in script

Post Reply
rhd_ole
Member
Posts: 101
Joined: Mon Jan 24, 2022 5:36 pm

Passing switch variable in script

Post by rhd_ole »

Just start by saying I'm not a scripting expert but trying to keep expanding my knowledge. I'm using python to manipulate some pdfs, excel, csv etc via execute command.

I've only used the %1 and %2 system variables for the input and output but I'd like to pass some Switch privatedata keys to the script but I'm not sure how like I do with javascript. Anyone able to help?
Color Science & Workflow Automation
User avatar
magnussandstrom
Advanced member
Posts: 350
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: Passing switch variable in script

Post by magnussandstrom »

Maybe this is what you looking for?

https://www.enfocus.com/en/appstore/pro ... and-friend
rhd_ole
Member
Posts: 101
Joined: Mon Jan 24, 2022 5:36 pm

Re: Passing switch variable in script

Post by rhd_ole »

magnussandstrom wrote: Thu Mar 14, 2024 5:10 pm Maybe this is what you looking for?

https://www.enfocus.com/en/appstore/pro ... and-friend
That sounds like it would work, but really after to to actually write it. I'm going to for sure try this out! Thanks as always.
Color Science & Workflow Automation
rhd_ole
Member
Posts: 101
Joined: Mon Jan 24, 2022 5:36 pm

Re: Passing switch variable in script

Post by rhd_ole »

I just figured it out and not sure why I spaced it, so posting for anyone else that is self-teaching.

variables are just passed in the command line in the execute command.

example: "path to your script" %1 %2 [PrivateData:Key="yourvalue"]

and then in the script they are done as:
argv[0] is reserved and shouldn't be used.
file_path = argv[1]
output_path = argv[2]
your variable in the script' = argv[3] since I'm on MacOS I Use sys.argv[]
and so on...
Color Science & Workflow Automation
Post Reply