BridgeTalk in a loop?

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

Mike Hale

BridgeTalk in a loop?

Post by Mike Hale »

Has anyone used BridgeTalk in a loop to send messages to other apps? This may be off topic but I am trying to write an Illustrator script that sends BridgeTalk messages to Photoshop. Photoshop process the first message in the loop then stops processing the rest until the Illustrator script is done. Then it process the rest. In the meantime in Illustrator the script waits for the timeout for each message after the first then stops.

The real problem is that Illustrator is coping paths to the clipboard and the message tells Photoshop to paste as path the rename the resulting work path. Because Photoshop is waiting only the first path copied is correct. The rest of the paths are the same last path Illustrator copied to the clipboard.
Paul MR

BridgeTalk in a loop?

Post by Paul MR »

I wonder if you have had a look at BridgeTalkIterator in Waslib ?
I have never used it but it might work for you Mike.
larsen67

BridgeTalk in a loop?

Post by larsen67 »

Bob showed me an example of bridgetalk daisy chaining in the ID scripting forum some time back… I possibly have it at home ( im at work now ) but you could search there… Anyhow I think for this app chat the bt.onResult needs an internal function to handle the iteration…
pfaffenbichler

BridgeTalk in a loop?

Post by pfaffenbichler »

The real problem is that Illustrator is coping paths to the clipboard and the message tells Photoshop to paste as path the rename the resulting work path.
Illustrator and Photoshop’s path description is pretty similar, if I’m not mistaken, so maybe you could store the points’ anchors etc. in an array in the meantime instead of using the clipboard?
larsen67

BridgeTalk in a loop?

Post by larsen67 »

This is very true I did look at re-constructing paths from AI to PS once before… Then got distracted…
Mike Hale

BridgeTalk in a loop?

Post by Mike Hale »

Thanks Paul, I had a look at BridgeTalkIterator but is wasn't clear to me how to use it. This is for a one time task and it's getting to the point where I am spending more time trying to automate it than it would take to do by hand. But it's a tedious task and I would really like to get this working.

Because I don't know the Illustrator DOM, I think trying to deconstruct the path in Illustrator would suck up more time that I can afford right now.

I have this to the point where I can copy the paths one at a time from Illustrator with the new path in Photoshop have the same name as the path in Illustrator. It's better than doing it all by hand but it is still tedious.
larsen67

BridgeTalk in a loop?

Post by larsen67 »

Mike, did you have a sample file?
Mike Hale

BridgeTalk in a loop?

Post by Mike Hale »

Yes, sorry. I followed Andrew's original setup of the forum and put it in the upload section.
larsen67

BridgeTalk in a loop?

Post by larsen67 »

Ah… didn't see all the way down there… Yep it worked… There were a couple of things that I thought were different though… The layers were the other way over NOT a problem easy switch over… You have named the layers in that but not the paths and compounds? They are unnamed as <Path> so the script will fail as is…
Mike Hale

BridgeTalk in a loop?

Post by Mike Hale »

I think I am getting crossed-eyed over tying to make this work. The original files from the client are unnamed and all on one layer. I wrote a jsx file to rename the paths and I split the simple and compound path by hand. I forgot to rename the paths in your sample and it seem mus-labeled the layers.

If I have to I can send the client your AppleScript and tell him he will have to make the assets files himself. Who knows maybe that will send some work your way.

But I still would like to have a working jsx version. If you find that InDesign BridgeTalkIterator example from Bob I would be even more grateful it you posted it here.

I also tried using a file to transfer the name and photoshop.executeSript but that didn't work either. It seems to me that Photoshop can't process a javascript while a javascript is running in Illustrator. They just queue up until the script is done. Does anyone know if Photoshop and Illustrator share the same javascript engine?