Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Passing Bridge Parameters into a photoshop script

Explorer ,
Jan 11, 2024 Jan 11, 2024

So I am getting into Bridge Javascripting and I am looking at passing scripts to Photoshop. Is there a way to have Bridge call another Javascript file but also pass parameter to it. I know I need to use bridge talk but I really dont want to write all the code as a single line string

 

as a very simple test I had Bridge open selected PNGs, Trim them, and then close them,. I did this all as a single line string. (this was just a test, that was an action I could batch before, but I felt it would be a good starting point.)

 

what I would love to do is write a "Trim" script and then pass the file into it (Example: TrimIt(A.png). The main reason I would want a script is I am going to be building a lot of these different functions (20-30) and I would love to not store them all in a single 10,000 line code file. and also not store them as single line strings for sending out through bridge. has anyone done soimething simialr to this so you can show me your system for doing this?

TOPICS
Scripting
282
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jan 17, 2024 Jan 17, 2024

So I ended up solving this by creating two functions. One to run scripts and one to save files.

 

the save files just records all the selections into a csv file, and then the script uses that csv file to do its thing. I can post them if anyone wants.

Translate
LEGEND ,
Jan 11, 2024 Jan 11, 2024

Use Batch and run PS scripts from a Photoshop action.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 11, 2024 Jan 11, 2024

I know I could do that for this example, but I will be doing things that are not always going to be Photoshop specific. And for that the batch option wont work. Some things will be Illustrator, InDesign, and some will be using Illustrator and Photoshop all within the same script.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 17, 2024 Jan 17, 2024
LATEST

So I ended up solving this by creating two functions. One to run scripts and one to save files.

 

the save files just records all the selections into a csv file, and then the script uses that csv file to do its thing. I can post them if anyone wants.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines