Copy link to clipboard
Copied
Hi,
I want a set of actions to be executed to an image. One of the action is to apply a pattern. I created a action in the hope that the new pattern can be selected before running the action. But the Pattern name and Pattern ID is hardcoded in the action. I have converted the action to a Javascript file and passing Pattern Name and Pattern ID to the function.
The problem that I face now is how to find the Pattern id of the pattern? Is there a way that I read the pat file to get the Pattern ID for each pattern.
Action: Theme1
Select layer “Art-11-1” Without Make Visible
Fill
From: 8.569 inches, 4.306 inches
Tolerance: 32
With Anti-alias
Using: pattern
Pattern: pattern
Name: “Calypso latte.png”
Pattern ID: “09a1120d-f7b6-11e3-a430-9f2bed0d0ccf”
There are 100s are pattern images in the pat file. How to get the Pattern ID?
Thanks
Govind.
Yep. I've got some code for this.
http://ps-scripts.cvs.sourceforge.net/viewvc/ps-scripts/xtools/xlib/PatternFile.js
I've just uploaded a new rev of this file that removes any external dependencies, adds a couple of new functions (including a much needed fill function), and has a more useful test function.
If the pattern you need an ID for is not already in a pattern file or you don't know what pattern file it's in, you can use xtools/xlib/PresetsManager.jsx to save the pattern to a temporary patte
...Copy link to clipboard
Copied
I think Xbytor has a script that might do that in his xtools, but I'm sure he can comment better on this.
Copy link to clipboard
Copied
Yep. I've got some code for this.
http://ps-scripts.cvs.sourceforge.net/viewvc/ps-scripts/xtools/xlib/PatternFile.js
I've just uploaded a new rev of this file that removes any external dependencies, adds a couple of new functions (including a much needed fill function), and has a more useful test function.
If the pattern you need an ID for is not already in a pattern file or you don't know what pattern file it's in, you can use xtools/xlib/PresetsManager.jsx to save the pattern to a temporary pattern file then read in that file with the code from PatternFile.js to get the ID. I never did figure out a way to determine the ID of a loaded pattern without saving it to and reading it from a .pat file.
Copy link to clipboard
Copied
I've been trying to get Adobe to add the ability to use the pattern thumbnail in a script ui, so that you can see which pattern you want. With the deco fill scripts, this would be great to be able to see and select multiple patterns then loop through multiple passes of various fill scripts. But your code is the next best thing, as long as you name the patterns well, so that you can remember what they look like. I'd also like to see the ability to use multiple patterns in one pass of the deco script, but the engineers keep telling me that that either isn't possible or too difficult to do with the funding sources that they have.
Copy link to clipboard
Copied
Thanks csuebele and xbytor. I am going through your library. It has great material.
In the interim, found a dirty solution to get going. I opened a layer and filled all the patterns of the pat file one after another, recorded the whole exercise as an action, downloaded the action as text file. It has the all pattern names and associated pattern id.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now