Copy link to clipboard
Copied
Hi, I'm trying to create an action that defines a pattern, but when recording, the action will use the name of the document I used to record the action, not the document I'm currently using the action with. For example, if I record the action with a floral pattern named "flowers.psd", and then try to perform the action on a geo pattern named "geo.psd", the action will load the geo pattern into the pattern presets but will name it "flowers.psd".
I found some previous answers with javascript templates to use, but they are all quite old and when I try to use them Photoshop tells me there are errors in the script. I'm familiar with implementing jsx files, but I'm not experienced in writing or editing, so I don't know how to troubleshoot the actual code. Would love some help here as this would save me soooo much time if I could make it work. Thanks!
I am using Adobe Photoshop 2026 on Sequoia 15.6
This is the old thread I was referencing, neither of the codes here work for me:
If you want the Define Pattern to use the Name of the current document, then record the Define Pattern action using Insert Menu Item, then when the Insert Menu Item dialog appears go to Edit>Define Pattern.
Copy link to clipboard
Copied
Do you have an open or save step in your action? If you change the names during a save especially, the action will include that name. You have to save without changing anything for it to not include the name.
Copy link to clipboard
Copied
Thanks for your reply! No, the only step in the action is "Make Pattern". Underneath the dropdown is:
Using: Selection of current document
Name: "[filename].psd"
It's not a naming or saving issue, the problem is that the action will always refer to the filename it recorded first, not the filename that is currently open. I have found this kind of issue crop up in other instances of trying to make actions that utilize presets; the action will use the original filename each time instead of the current filename. It makes sense from a coding point of view, but it would be great to find a way to override.
Copy link to clipboard
Copied
You might be able to script this to avoid the problem.
Copy link to clipboard
Copied
Yep, script help is exactly what I'm asking for 🙂
Copy link to clipboard
Copied
If you want the Define Pattern to use the Name of the current document, then record the Define Pattern action using Insert Menu Item, then when the Insert Menu Item dialog appears go to Edit>Define Pattern.
Copy link to clipboard
Copied
Holy moly that did it!!! THANK YOU SO MUCH you have saved me a ton of time
Find more inspiration, events, and resources on the new Adobe Community
Explore Now