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

load files to stack with out file extention as part of layer name

New Here ,
Oct 10, 2012 Oct 10, 2012

Copy link to clipboard

Copied

Ok so as the title says i'm trying to figure out how to modify the "Load Files to Stack..." script so that it doesn't put the file extention as part of the layer name. it makes it a pain to have to go through and remove it when dealing with a lot of layers. I'm using photoshop CS5 on Win 7.

Also if possible a script that would make Comp Layers for each layer created when loading files to stack it's a bit much to ask but worth a shot

TOPICS
Actions and scripting

Views

4.2K

Translate

Translate

Report

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
Adobe
Community Expert ,
Oct 11, 2012 Oct 11, 2012

Copy link to clipboard

Copied

I suspect you’d have to edit the line

app.activeDocument.activeLayer.name = this.fName;

in »CreateImageStack.jsx« to change the way the Layers are named in »Load Files into Stack.jsx«, but quite frankly I have not tried, because those Scripts are a bit complicated for me.

Votes

Translate

Translate

Report

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
Guru ,
Oct 11, 2012 Oct 11, 2012

Copy link to clipboard

Copied

You also have to be carefull editing that script because it is used by other Adobe scripts.

I think you would be better of creating a script that loops through the layers and removes the extension.

As to the other request, do you want a layer stack that has one layer for each of the layer comps in a document?

Votes

Translate

Translate

Report

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
New Here ,
Oct 11, 2012 Oct 11, 2012

Copy link to clipboard

Copied

Yea i have been abit wary abut just diving in and comment out stuff i did try to make a dupe of the script by renaming the script in it and the actual file but it acted a but odd.

i'll have to give a try with that because yea it wuld only need to remove the last four char from each layer.

I have been making what i call clothing templats which are all the different colors that a shirt comes in and add a design to it and save it as a single file. I have been trying to figure out a way to automate it a bit more so i don't have to go through and save by hand each variation and making and updating a comp layer and have it automaticly go through make the files is much faster than me going through and saving each.

Votes

Translate

Translate

Report

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
Guru ,
Oct 11, 2012 Oct 11, 2012

Copy link to clipboard

Copied

Sounds like I got your second request backwards. You want a script that creates layer comps? That should be doable, but how is the script to know which layers to include in a given comp?

Votes

Translate

Translate

Report

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
New Here ,
Oct 11, 2012 Oct 11, 2012

Copy link to clipboard

Copied

if i could get it to load files in to a stack whith out the file extention and create a comp layer loaded in to the stack I would do cart wheels, i have all the individual files prenamed following my naming convention. In my other post aboiut removing the _0000_ i showed a few of the comp layers i saved as files  BBC-1-_0002_01320-HeatherGrey-Black.jpg.

the  "BBC-1-"  is for the group and i can add that whan saving and make them ubique  the "01320-HeatherGrey-Black.jpg" is the style and color of the shirt when i loaded files in to the stack it was named 01320-HeatherGrey-Black.png like the 10 other colors that it can come in.

So i'm now thinking it might be easier to make a script that removed the last four char from the layer and creates a comp layer of it using the same name as the layer it really doesn't matter what is shown in the comp layer because i'm going to update it for each group before i run the layer comps to files.

Votes

Translate

Translate

Report

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
Guru ,
Oct 11, 2012 Oct 11, 2012

Copy link to clipboard

Copied

If I understand what you want, this should do both.

for(var layerIndex=0;layerIndex<app.activeDocument.layers.length;layerIndex++){

    app.activeDocument.layers[layerIndex].name = app.activeDocument.layers[layerIndex].name.replace(/\..{2,4}$/,'');

    app.activeDocument.layerComps.add(app.activeDocument.layers[layerIndex].name, '', true, true, true );

    app.activeDocument.layers[layerIndex].visible = false;

}

Votes

Translate

Translate

Report

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
New Here ,
Oct 11, 2012 Oct 11, 2012

Copy link to clipboard

Copied

in my very general understanding of scripts uh yea. lol  now how would i implyment it use a droplet or make a new script for the scripting menu i'm guessing it could be done both ways but i never really got in to the automation and scripting stuff for PS untill the last 8 months which is kinda pathetic because i have used PS off and on since PS4 like 1999

Votes

Translate

Translate

Report

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
Guru ,
Oct 11, 2012 Oct 11, 2012

Copy link to clipboard

Copied

I don't use droplets so I am not sure about that but to have this appear in the File-Scripts menu all you need to do is copy that code and paste it into a plain text editor, save it with whatever name you like in the presets/scripts folder and restart Photoshop.

Just make sure that you save it as plain text.

Votes

Translate

Translate

Report

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
New Here ,
Oct 11, 2012 Oct 11, 2012

Copy link to clipboard

Copied

Ill give it a whirl and see how it goes though i'm a bit PS'd out right now did a few hundred images yesterday so looking at PS right now isn't really high on my list of stuff to do today...

Thank you for your help it shold make my life a bit less repetitive and give me the ability to get more done in less time, you may stumble apon a thank you hidden in the html of the site i'm working on...

Votes

Translate

Translate

Report

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
Explorer ,
May 01, 2013 May 01, 2013

Copy link to clipboard

Copied

If anyone is just looking to import files into stack without extension names here's what I did:

1- Go to your adobe scripts folder:

64 bit - C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Presets\Scripts\
32 bit - C:\Program Files (x86)\Adobe\Adobe Photoshop CS6\Presets\Scripts\

2 - Copy and paste these 2 files somewhere other than in the adobe folder like the desktop (I had to due to permission restrictions when saving):

Load Files into Stack.jsx
Stack Scripts Only\CreateImageStack.jsx

3 - Rename these files to

Load Files into Stack - no ext.jsx

CreateImageStack_noext.jsx

4 - edit Load Files into Stack - no ext.jsx (I use notepad++) and save

Line 16 - <name> Load Files into Stack (no extension) </name>
...
Line 43 - $.evalFile(g_StackScriptFolderPath + "CreateImageStack_noext.jsx");

5 - edit CreateImageStack_noext.jsx, insert this line into "line 411" (just above "app.activeDocument.activeLayer.name = this.fName;") and save

Line 411 - this.fName = this.fName.replace(/(?:\.[^.]*$|$)/, '');

6 - copy and paste these edited files back into your adobe ...\Presets\Scripts\ folder (overwrite folder), reload photoshop and you should now see in File > Scripts > Load Files into Stack (no extension) available!

And for the lazy, here are the two files

load_files_into_stack_no_ext.zip

drop these in your photoshop scripts folder:

64 bit - C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Presets\Scripts\

32 bit - C:\Program Files (x86)\Adobe\Adobe Photoshop CS6\Presets\Scripts\

Hopefully this helps someone! Why adobe just doesn't have this as the default is beyond me.

Votes

Translate

Translate

Report

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
New Here ,
May 01, 2013 May 01, 2013

Copy link to clipboard

Copied

http://www.jordanandairmax.com/ this web site, the logo is png, bug why can't use same to gif file ? the png file is bug for ie6 ? 

Votes

Translate

Translate

Report

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
New Here ,
Jun 07, 2014 Jun 07, 2014

Copy link to clipboard

Copied

I'm sorry to resurrect an old thread but I'm facing a very similar problem and I believe finalizing the thread would be beneficial to other people having similar problem and finding this thread.

I very much like the solution by JoeHoran because it doesn't involve any additional "for" loops that slow down the execution of the script. However the solution doesn't entirely work. When loading several files to a stack, only the first layer name is changed, the rest of the layers still keep the extension name.

I added a little debugging line and it really seems like the part of the code in CreateImageStack is executed only once during the layer stacking process. I tried to find the correct code that actually gives names to those layers but was unsuccessful. Could somebody help?

Votes

Translate

Translate

Report

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 ,
Oct 13, 2014 Oct 13, 2014

Copy link to clipboard

Copied

LATEST

I noticed it doesnt work anymore either, but I found an alternative.

Download the script "Layer Name Edit.zip" from user Paul R -- message 10.

http://www.retouchpro.com/forums/photoshop-scripting/23234-script-find-replace-text-layer-names.html

It allows you to edit multiple layer names.  One of the options is to remove X number of characters from the end of every selected layer.

Votes

Translate

Translate

Report

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