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

How to get the Pattern ID of pattern in pat file

Community Beginner ,
Nov 09, 2014 Nov 09, 2014

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.

TOPICS
Actions and scripting
1.4K
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

Advisor , Nov 09, 2014 Nov 09, 2014

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

...
Translate
Adobe
Community Expert ,
Nov 09, 2014 Nov 09, 2014

I think Xbytor has a script that might do that in his xtools, but I'm sure he can comment better on this.

ps-scripts - Browse Files at SourceForge.net

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
Advisor ,
Nov 09, 2014 Nov 09, 2014

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.

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
Community Expert ,
Nov 09, 2014 Nov 09, 2014

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.

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
Community Beginner ,
Nov 10, 2014 Nov 10, 2014
LATEST

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.

Thanks  csuebelexbytor2 for the help.

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