Action: how can i grab a file’s name?

Z
Posted By
Ziggy
Jan 20, 2006
Views
253
Replies
6
Status
Closed
I’d like to write an Action in which the Background layer’s name is changed to the file’s name.

e.g., for a file PICT0156.jpg

Set Background
Name: PICT0156.jpg

Unfortunately, I cant think of any way of grabbing the file’s name.

Any ideas?

-zig

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

N
nomail
Jan 21, 2006
Ziggy wrote:

I’d like to write an Action in which the Background layer’s name is changed to the file’s name.

e.g., for a file PICT0156.jpg

Set Background
Name: PICT0156.jpg

Unfortunately, I cant think of any way of grabbing the file’s name.
Any ideas?

Forget it. You cannot change the name of the background layer. It will always be called ‘Background layer’.


Johan W. Elzenga johan<<at>>johanfoto.nl Editor / Photographer http://www.johanfoto.nl/
E
edjh
Jan 21, 2006
Johan W. Elzenga wrote:
Ziggy wrote:

I’d like to write an Action in which the Background layer’s name is changed to the file’s name.

e.g., for a file PICT0156.jpg

Set Background
Name: PICT0156.jpg

Unfortunately, I cant think of any way of grabbing the file’s name.
Any ideas?

Forget it. You cannot change the name of the background layer. It will always be called ‘Background layer’.
Well, it can be changed, but then it would be a layer, not a Background (not flattened).

But it could probably be done with a script since there are scripts that put the file’s name on a text layer.


Comic book sketches and artwork:
http://www.sover.net/~hannigan/edjh.html
Comics art for sale:
http://www.sover.net/~hannigan/batsale.html
MR
Mike Russell
Jan 21, 2006
"Johan W. Elzenga" wrote in message
Ziggy wrote:

I’d like to write an Action in which the Background layer’s name is changed
to the file’s name.

e.g., for a file PICT0156.jpg

Set Background
Name: PICT0156.jpg

Unfortunately, I cant think of any way of grabbing the file’s name.
Any ideas?

Forget it. You cannot change the name of the background layer. It will always be called ‘Background layer’.

This is not really true. The Background layer can be converted to a normal layer, and then renamed like any other layer.

This can’t be done with an action, but it could be done with a script. Adobe has a free scripting SDK that is well worth a look. Here’s a site with various items of interest to scripting folks:
http://www.ps-scripts.com/

Here is an example of a scripot that accesses the file name and stashes it in a text layer. It could be modified to change the name of the background layer:
http://www.ps-scripts.com/bb/viewtopic.php?t=284&

Mike Russell
www.curvemeister.com
N
nomail
Jan 21, 2006
Mike Russell wrote:

"Johan W. Elzenga" wrote in message
Ziggy wrote:

I’d like to write an Action in which the Background layer’s name is changed
to the file’s name.

e.g., for a file PICT0156.jpg

Set Background
Name: PICT0156.jpg

Unfortunately, I cant think of any way of grabbing the file’s name.
Any ideas?

Forget it. You cannot change the name of the background layer. It will always be called ‘Background layer’.

This is not really true. The Background layer can be converted to a normal layer, and then renamed like any other layer.

I know that, but as you said, it isn’t a background layer anymore. And since the OP is using a JPEG as example (which doesn’t support layers), I don’t think he is lookking for a solution that turns the background layer into a normal layer.


Johan W. Elzenga johan<<at>>johanfoto.nl Editor / Photographer http://www.johanfoto.nl/
N
nomail
Jan 21, 2006
edjh wrote:

Johan W. Elzenga wrote:
Ziggy wrote:

I’d like to write an Action in which the Background layer’s name is changed to the file’s name.

e.g., for a file PICT0156.jpg

Set Background
Name: PICT0156.jpg

Unfortunately, I cant think of any way of grabbing the file’s name.
Any ideas?

Forget it. You cannot change the name of the background layer. It will always be called ‘Background layer’.
Well, it can be changed, but then it would be a layer, not a Background (not flattened).

I know that, but as you said, it isn’t a background layer anymore. And since the OP is using a JPEG as example (which doesn’t support layers), I don’t think he is lookking for a solution that turns the background layer into a normal layer.


Johan W. Elzenga johan<<at>>johanfoto.nl Editor / Photographer http://www.johanfoto.nl/
Z
Ziggy
Jan 21, 2006
"Mike Russell" wrote

"Johan W. Elzenga" wrote in message

Ziggy wrote:

I’d like to write an Action in which the Background layer’s name is changed
to the file’s name.

e.g., for a file PICT0156.jpg

Set Background
Name: PICT0156.jpg

Unfortunately, I cant think of any way of grabbing the file’s name.
Any ideas?

Forget it. You cannot change the name of the background layer. It will always be called ‘Background layer’.

This is not really true. The Background layer can be converted to a normal layer, and then renamed like any other layer.

This can’t be done with an action, but it could be done with a script. Adobe has a free scripting SDK that is well worth a look. Here’s a site with various items of interest to scripting folks:
http://www.ps-scripts.com/

Here is an example of a scripot that accesses the file name and stashes it in a text layer. It could be modified to change the name of the background layer:
http://www.ps-scripts.com/bb/viewtopic.php?t=284&

Thanks, that’s a huge help Mike. I’ll look into a modification of the script.
-zig

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

Related Discussion Topics

Nice and short text about related topics in discussion sections