Skip to main content
March 16, 2008
Question

How can I use Applescript to name a layer the same as the document name in Photoshop.

  • March 16, 2008
  • 6 replies
  • 821 views
I have written a simple Applescript to name the background layer of a Photoshop CS3 document the name of the document. I'd like to be able to have this run whenever a document is opened, but the Scripts Event Manager doesn't seem to be able to run Applescripts, only Javascripts. Anybody have any ideas on how to do this?

The reason I want to do this is that I use Photoshop to make collages of many photos. I'd like each layer in the collage to be named for the document it was copied from. If the layer is named the same as the document, then when I copy it into the master document, it has the proper name.
This topic has been closed for replies.

6 replies

March 18, 2008
Thanks for all the suggestions.
Known Participant
March 18, 2008
For AppleScript you could also use Fast Scripts this is very good for adding keyboard short cuts:
http://www.red-sweater.com/fastscripts/

For your file/layer naming issue have you looked at Dr Browns Services? with this you could try Merge-A-Matic you can access your files through Bridge selection. If you put an empty doc template as the front item of your selection you should get what you want.
MarkWalsh
Inspiring
March 18, 2008
You can use the applescript Script Menu to run scripts in Photoshop (or any application).

If you don't have it installed, run the AppleScript Utility.app (find it in the Applescript folder in your applications folder) and make sure the 'Show Script Menu in menu bar' is checked.

Edit: I thought you'd be able to use this with an action by inserting a menu item, but apparently it doesn't recognize the appescript menu.
Participating Frequently
March 18, 2008
> Is there any way to call an Applescript from within Photoshop?

Unfortunately no.
March 17, 2008
Thanks, I'll give that a try. Is there any way to call an Applescript from within Photoshop?
Known Participant
March 18, 2008
Connie_Hoyland@adobeforums.com wrote:
> Thanks, I'll give that a try. Is there any way to call an Applescript from within Photoshop?

Not directly. You may be able to execute an Applescript via File.execute() but
I've never actually tried it.

-X
--
for photoshop scripting solutions of all sorts
contact: xbytor@gmail.com
Participating Frequently
March 17, 2008
You can make an AppleScript droplet that opens the files into Photoshop and renames the layers. You would drop the files onto the AS icon instead of the PS icon to open them.

Carl.