Layer Renaming in script
Hai I am creating a Photoshop panel using Adobe configurator4 and i want to do buttons which have name already defined eg Silo, Retouch, Skin etc to rename both single or multiple layer which are selected . There are many script which will open its own window but i dont want that . One i got from this link its for illustrator but it runs in photoshop" https://forums.adobe.com/message/2639824 But its will rename all the layer even if its not selected or it will rename only the layers which are visible. I am not good in Scripting . For now i have created a action script which is simple and connected to the button in Adobe Configurator4 but it will rename only one Can you please help me
You obviously don't know this, but if you option (alt) double click on the layer name, the Layer Properties dialog comes up, allowing you to name the layer in a modal dialog. I also find it easier to rename layers this way. A shortcut can also be set up to bring up Properties.
The History of this was that in Photoshop 6 they made it necessary to rename layers only in the layer properties dialog. But they had too many complants, and in 7 the default went back to the way it is now - renaming using the tiny text in the layers panel- so both methods are now available with the Option modifier.
Similar Messages
-
Renaming a SCRIPT??
hi
please tell how to rename a SCRIPT.I had developed an script,now i need to change its name,please tell how to do this.
vipin sharmaHi Vipin,
The only way to rename is to Make a Copy of the original form and give it the new name.
Regards,
Chandra Sekhar -
Reworking Photoshop layer renaming script for Illustrator
The Photoshop scripting guru Paul R over at RetouchPro has created a really cool script to batch rename and number selected Photoshop layers. I haven't found anything similar on the Illustrator side.
He's given permission for me to post it here in my hopes that some Illustrator scripting genius could come up with a similar script for Illustrator. Would it be terribly difficult to convert this into something Illustrator could use?
http://www.mediafire.com/file/g7usr73u0236p0a/Rename_&_Renumber_Selected_Layers.jsx
http://www.mediafire.com/file/dbah74x13bsa74c/Rename_&_Renumber_Selected_Layers.jsx.zipHola Julio, I updated the script to rename visible Layers or Sublayers, and also fixed the Color
#target illustrator
main();
function main(){
if(!documents.length) return;
//var allLayers = app.activeDocument.layers;
var win = new Window( 'dialog', '' );
g = win.graphics;
// var myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [0.99, 0.99, 0.99, 1]); // CS5
var myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [0.50, 0.50, 0.50, 1]); // CS6
g.backgroundColor = myBrush;
win.orientation='stack';
win.p1= win.add("panel", undefined, undefined, {borderStyle:"black"});
win.g1 = win.p1.add('group');
win.g1.orientation = "row";
win.title = win.g1.add('statictext',undefined,'Rename Visible Layers or Sublayers');
win.title.alignment="fill";
var g = win.title.graphics;
g.font = ScriptUI.newFont("Georgia","BOLDITALIC",22);
win.g5 =win.p1.add('group');
win.g5.orientation = "column";
win.g5.alignChildren='left';
win.g5.spacing=10;
win.g5.st1 = win.g5.add('statictext',undefined,'New layer name');
win.g5.et1 = win.g5.add('edittext');
win.g5.et1.preferredSize=[250,20];
win.g10 =win.p1.add('group');
win.g10.orientation = "row";
win.g10.alignment='fill';
win.g10.spacing=10;
win.g10.st1 = win.g10.add('statictext',undefined,'Serial Number');
win.g10.et1 = win.g10.add('edittext',undefined,'1');
win.g10.et1.preferredSize=[50,20];
win.g10.et1.onChanging = function() {
if (this.text.match(/[^\-\.\d]/)) {
this.text = this.text.replace(/[^\-\.\d]/g, '');
win.g10.st1 = win.g10.add('statictext',undefined,'Length');
var nums=[2,3,4,5];
win.g10.dl1 = win.g10.add('dropdownlist',undefined,nums);
win.g10.dl1.selection=0;
win.g15 =win.p1.add('group');
win.g15.orientation = "row";
win.g15.alignment='fill';
win.g15.cb1 = win.g15.add('checkbox',undefined,'Reverse layer order');
win.g15.cb2 = win.g15.add('checkbox',undefined,'Rename Sublayers Only');
win.g100 =win.p1.add('group');
win.g100.orientation = "row";
win.g100.alignment='center';
win.g100.spacing=10;
win.g100.bu1 = win.g100.add('button',undefined,'Rename');
win.g100.bu1.preferredSize=[120,30];
win.g100.bu2 = win.g100.add('button',undefined,'Cancel');
win.g100.bu2.preferredSize=[120,30];
win.g100.bu1.onClick=function(){
if(win.g5.et1.text == ''){
alert("No layer name has been entered!");
return;
win.close(0);
var sublayersOnly = win.g15.cb2.value;
var visibleLayers = [];
getVisibleLayers (app.activeDocument, visibleLayers, sublayersOnly);
if(win.g15.cb1.value) visibleLayers.reverse();
for(b=0; b<visibleLayers.length; b++){
var LayerName = win.g5.et1.text + zeroPad((Number(win.g10.et1.text)+Number(b)), Number(win.g10.dl1.selection.text));
visibleLayers[b].name = LayerName;
win.center();
win.show();
function getVisibleLayers(container, visibleLayers, sublayersOnly) {
for(var a=0; a<container.layers.length; a++){
var ilayer = container.layers[a];
if (ilayer.visible) {
if (sublayersOnly) {
getVisibleLayers (ilayer, visibleLayers, false); // false to process only 1 sublayer depth
else
visibleLayers.push(ilayer);
function zeroPad(n, s) {
n = n.toString();
while (n.length < s) n = '0' + n;
return n; -
Actions ignoring modal control for layer renaming, Photoshop CS6
Hey, everyone! I often run actions that have modal control for certain steps turned on, in particular, when I want to give a layer a custom name. Prior to CS6, I'd run my action, the window would open allowing me to rename my layer, and then it finishes my action. However, in CS6, it seems to ignore the modal control button selected, puts in whatever the default info is and continues on. This hoses quite a few of my actions that I've been using for years. Submit a bug report?
Thanks,
BruceBruce it looks like you found yet an other bug in CS6 please report it at http://feedback.photoshop.com/photoshop_familyhttp://feedback.photoshop.com/photoshop_family
Set current Layer name fials to display its dialog when step is set to display dialog. -
Selecting a Graphic Layer with Apple Script
I'm trying to build on a very helpful post by sstanleyau showing how to choose different layers in a placed PSD or PDF. Unfortunately, I'm stuck in my test script. It seems so simple …
Here's what the script should do after an image is placed in a text frame:
1. "Read" the names of each of the graphic layers in the placed graphic.
2. If one of the names contains a string, then
3. Turn current visibility of that layer on
4. Turn the visibility of every other layer off.
However, my script seems to come up with a different result each time I run it and often fails to "find" a layer that I know is there. Is it possible that my script can't access the name of a graphic layer if its visibility is set to off?
Here's why I've got
--before running, user selects a test frame containing a placed PDF with multiple layers named blue, red and green.
tell application "Adobe InDesign CS4"
set theFrame to item 1 of selection
set glOptions to graphic layer options of graphic 1 of theFrame
set theName to text of "blue"
repeat with z from 1 to count of graphic layers in glOptions
if name of graphic layer z of glOptions contains theName then
repeat with d from 1 to count of graphic layers in glOptions
if current visibility of graphic layer d of glOptions ≠ false then
set current visibility of graphic layer d of glOptions to false
end if
end repeat
if current visibility of graphic layer d of glOptions = false then
set current visibility of graphic layer z of glOptions to true
end if
end if
end repeat
end tellIm NOT sure if you have just made this a little over complicated… This works just fine for me. Tested with about a dozen psd layers…
tell application "Adobe InDesign CS2"
tell active document
tell rectangle 1
tell graphic 1
tell graphic layer options
set GLC to count of graphic layers
repeat with i from 1 to GLC
if name of graphic layer i ≠ "Blue" then
set current visibility of graphic layer i to false
else
set current visibility of graphic layer i to true
end if
end repeat
end tell
end tell
end tell
end tell
end tell
This variant also works as I would have expected too… Retaining visibility from a list…
tell application "Adobe InDesign CS2"
tell active document
tell rectangle 1
tell graphic 1
tell graphic layer options
set On_List to {"Red", "Aqua", "Orange"}
set GLC to count of graphic layers
repeat with i from 1 to GLC
if name of graphic layer i is not in On_List then
set current visibility of graphic layer i to false
else
set current visibility of graphic layer i to true
end if
end repeat
end tell
end tell
end tell
end tell
end tell -
[10G2 on XP PRO] Rename file script returns error
Hi,
I mistakenly created a "Users03" datafile without the .dbf extension.
Now I would like to add it in order to use wildcards in scripts.
Here is the "Rename" script:
>
alter tablespace users rename datafile
'l:\oracle\product\10.2.0\oradata\oracompta\users01.dbf',
'l:\oracle\product\10.2.0\oradata\oracompta\users02.dbf',
'l:\oracle\product\10.2.0\oradata\oracompta\users03'
to
'l:\oracle\product\10.2.0\oradata\oracompta\users01.dbf',
'l:\oracle\product\10.2.0\oradata\oracompta\users02.dbf',
'l:\oracle\product\10.2.0\oradata\oracompta\users03.dbf'
Here are the output from the "dba_datafiles" view and error message for the rename:
>
SQL> @c:\jb\data\sources\oracle\dba\datafiles
...[RETURN].......
FILE_NAME TABLESPACE_NAME AUTO MAXBYTES INCREMENT_BY
L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\EXAMPLE01.DBF EXAMPLE YES 34359721984 80
L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\SYSAUX01.DBF SYSAUX YES 34359721984 1280
L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\SYSTEM01.DBF SYSTEM YES 34359721984 1280
L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\UNDOTBS01.DBF UNDOTBS1 YES 34359721984 640
L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\UNDOTBS02.DBF UNDOTBS2 YES 629145600 12800
L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\USERS01.DBF USERS
L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\USERS02.DBF USERS
L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\USERS03 USERS
8 ligne(s) sélectionnée(s).
SQL> @c:\jb\data\sources\oracle\dba\renamefile
alter tablespace users rename datafile
ERREUR à la ligne 1 :
ORA-01525: échec du changement de noms de fichier de données
ORA-01523: impossible de renommer le fichier de données en 'l:\oracle\product\10.2.0\oradata\oracomp
Maybe there is some limit to the input line length in SQL*Plus?
I can't find how to rename a datafile from the OEM console.
Looks like I'll have to create a "usersbis" tablespace and copy every object into it, then drop users tablespace.
Or I'll find an inocuous DBA command to test the correct syntax for referencing datafiles names under Windows.
Many thanks for your help :-)Hi,
I tried your commands after a cold backup.
Here is the SQL*PLUS output:
******************** QUOTE ********************************************
SQL> startup mount
Instance ORACLE lancée.
...[RETURN].......
Total System Global Area 272629760 bytes
Fixed Size 1248504 bytes
Variable Size 100664072 bytes
Database Buffers 167772160 bytes
Redo Buffers 2945024 bytes
Base de données montée.
SQL> alter tablespace users rename datafile
2 'l:\oracle\product\10.2.0\oradata\users03'
3 to
4 'l:\oracle\product\10.2.0\oradata\users03.dbf';
alter tablespace users rename datafile
ERREUR à la ligne 1 :
ORA-01109: base de données non ouverte
SQL> alter database open;
alter database open
ERREUR à la ligne 1 :
ORA-01157: impossible d'identifier ou de verrouiller le fichier de données 7 - voir le fichier de tr
ORA-01110: fichier de données 7 : 'L:\ORACLE\PRODUCT\10.2.0\ORADATA\ORACOMPTA\USERS03'
SQL> alter tablespace users rename datafile
2 'l:\oracle\product\10.2.0\oradata\users03'
3 to
4 'l:\oracle\product\10.2.0\oradata\users03.dbf';
alter tablespace users rename datafile
ERREUR à la ligne 1 :
ORA-01109: base de données non ouverte
********************** END QUOTE ********************************************
I must have done something wrong.
I'll try renaming the file from DOS and open the database.
Many thanks for your reply. -
I have a bunch of embedded movies that are controlled by
hidden buttons. I would like to be able to adjust the stacking
order or z-depth of the layers by scripts to solve a design
problem. What I've ended up with is if you roll over button 3 the
#3 movie zooms up to it's desired position on the screen and plays.
If you then roll over button 1 the #3 movie continues to play until
the end then zooms or scales down to it's place holder size while
movie 1 is scaling up and moving into position to play. The problem
is that Movie 3 is above Movie 1 so while 3 is continuing to the
end and one is moving into position you can't see movie 1 because
it's covered by movie 3 until movie 3 scales back down and moves to
it's proper position.
What I'd like to do is to force whatever movie I've currently
over to move to the top layer. Something like:
if (rollOver button1 ) {this movie on top} else {this movie
in original order}
Is this possible? Spent hours with the help files and
searching tutorials with no success.use the swapDepths() method of movieclips to control the
z-depth with actionscript. -
Hi,
1. Can a SAP script form be renamed?
2. How to change the Development class attached to a form?
Thanks.
PankajUse program RSWBO052 for changing the development class of sapscript.
R3TR FORM zname1
Ankur Bhandari
p.s Reward point if it helps. -
Preserve background layer when cropping (script)
I understand that if you choose "Delete Cropped Pixels" in the crop tool, that it will preserve the background layer, as a background layer. However, I wished that I could still maintain this function when cropping without the delete cropped pixels option checked as well. It seems like a silly thing to have to recreate that layer as a background manually every time. Is there a script out there that can do this?
The background layer is a special layer that dose not support transparency so if the change the canvas size pixels will be added or removed to match the canvas sizes a document need not have a background layer. In that case the document canvas size is then just a clipping mask for your layers the size and pixels can remain unchanged.
-
I assume this is possible via scripting, but as I'm new to scripting I'm just dipping my toes in for this.
I have a number of actions, all produce a variety of colour effects/tone. For a specific job I need to run each action one-by-one and output the result as a new PSD file using the Action's name as the filename for the PSD document.
IE :
FILE.PSD
run action 'Blues to shadows'
FILE.PSD saved to folder as 'Blues to shadows.PSD'
does anyone have any pointers how to get to this stage?
Thanks.I already wrote this a few years ago.
http://ps-scripts.cvs.sourceforge.net/viewvc/*checkout*/ps-scripts/xtools/apps/ActionSetRu nner.js
It should do what you want.
-X -
Hi there,
I've run into a little problem moving forward with a project, I've got quite a few files, each of them has about 15 layers.
These layers contain underscores "_" in the name, which all need to be replaced with a hyphen "-".
Is it possible to have a script do this? And if so, how would I go about writing one? Or even better - could I get one that is already written!
Thanks a bunch.i·ro·ny
/ˈīrənē/
The expression of one's meaning by using language that normally signifies the opposite.
In this case, W_J_T said:
W_J_T wrote:
Maybe this will help get you started:
When he has written precisely the script I asked for - thus finishing what I had set out to achieve.
hence irony.
But thank you for your contribution. -
Is there a script for renaming layers in ID CS5?
Hello,
I am new to scripting (I just started today) so far I have found some very useful existing scripts to help automate my workflow. I am wondering if anyone knows of the existence of a layer renaming script for InDesign.
I have seen similar scripts for PS. I want to learn how to script but I am in need of this one for Monday...
Thanks in advance!Antonio:
Please remember that we're all volunteers here. If you can ask your question so we can understand it, we can probably help you. But if you cannot, it would take quite a lot of effort on our part to even determine what you asking.
Jongware wrote in the other thread:
This is quite a specialized case so it's unlikely there "is" a script. But there "could be" one. Ask in the scripting forum, as there are some people in there sharpening their skills with such requests. Make sure to detail what you need it to do: which layers? rename to what? Et cetera.
You're not doing a good job on detail. How would the script know what to change your first, 3rd, 4th, and 5th "atoms" to?
You have given us no information that I can see. -
Rename Layer, Group, Object Javascript
Hey Guys,
I'm trying to write a script that renames a layer, and group within the layer, then an object within the layer (but not a part of the group) and have it run in a loop.
Here's what I've got so far, the group rename doesn't work.
#target Illustrator
var doc = app.activeDocument;
idLayers(doc)//IRename layers
idGroups(doc)//Rename groups
function idLayers(doc){
for(i=0;doc.layers.length>i;i++){
doc.layers[i].name= 'id:GTM_Group '+(i+1)
function idGroups(doc){
for(i=0;doc.groups.length>i;i++){
doc.groups[i].name= 'id:GTM_Group '+(i+1)
I haven't put in anthing to rename the single object yet since I cant even get the group rename to work. I suspect that the group re-name section isn't working because I'm either using bad syntax or an invalid command. Any ideas?Found out that I was really close, and some interesting facts about how thorough illustrator will be when renaming groups across the board. Basically the files I'm working with have a layer that requires a specific name and number, and group within that layer and an object outside of that group but still in the same layer. Within the group is a compound path made up of several objects, I noticed that the when I started getting the group rename working it was skipping multiple numbers because it was going inside the compound path, find groups within the compound path and renaming them as well. So as long as I make sure there are no groups hidden within the groups I wanted to rename the script works like a charm.
Anyway this is what that script looks like I'm still working on getting the up-grouped object renamed. I notice this discussion has gotten a few views since I went to lunch. I'll post the final version at the end of the day if I have time.
If anyone has any suggestions or constructive advice I'd be very open to hear it.
#target Illustrator
var doc = app.activeDocument;
idLayers(doc)//IRename layers
idGroups(doc)//Rename groups
function idLayers(doc){
for(i=0;doc.layers.length>i;i++){
doc.layers[i].name= 'Named Layer '+(i+1)
function idGroups(doc){
for(i=0;doc.groupItems.length>i;i++){
doc.groupItems[i].name= 'Named Group '+(i+1) -
Rename layers with layer 1, layer 2 till and layer N
My Name is Sathya Murthy
I have psd files with many layers each with different names
I want to rename the layer which i have selected using right click with name Layer 1
Next layer which I right click with layer 2 and so on till layer N
and layers with are left out without renaming should be put in a new layer set or group in layers separately in the same file.
which i have opened
and layers should be arranged like this
till Layer N
Layer 4
Layer 3
Layer 2
Layer 1
Group or Layer Set
Background
I hope you understand what i am saying
I want scripting for that action as I have more files to rename layers so by using scripts i can work little bit faster
anyone knowing please help
Thanks In Advance
Sathya MurthyI don’t think one can select Layers in the Layers Panel or on the Canvas while a Script is running.
One could select the Layers via a dialog, but that would take focus and need to present a list of the Layers.
Alternatively it might be possible to set up a work-around by selecting a Layer, invoking a Script (either by Keyboard Shortcut or from a Configurator Panel) that stores data (the activeLayer in this case), repeating that as often as needed and at the end of the selection process trigger another Script (or possibly the same with the shift-key pressed) that then processes that stored information.
But maybe someone else has more insightr or a better idea. -
Hi,
I'm pretty new to scripting in adobe, but I thought this should be a simple one (think again...):
I wanted to go over an array of all the psd-images in a selection or on a page in indesign, and then try to set their layer comp to a specific one (like "Diffuse".
In photoshop I could make an action that would do this for me, but it seems that there are no easy ways in Indesign to do this.
There also seems no way to change the layer comp or layer visibility for multiple selection...
If anyone knows if it is possible at this moment to use layer comps in scripting (and how) or some kind of action for Indesign, I'll try to tackle the rest of the problem myself (and be forever grateful).
If it isn't possible, I how it will be in CS6.
Thanks to anyone interested,
Mattaias
ps: currently trying to solve this in JavaScript for CS5.5.Thanks for the information so far, but I've been looking at the links you added and haven't found anything about the scripting of layer comps...
Here is the adjusted sample of your code:
function Main() {
var mySelection = app.selection;
for(var n=0;n<mySelection.length;n++){
if(mySelection[n].graphics.length === 1 && mySelection[n].graphics[0].imageTypeName === "Photoshop"){
//Do your stuff on the selected frame or on the individual placed PSD file:
// Adjusted Sample code:
mySelection[n].images[0].graphicLayerOptions.graphicLayers.itemByName("Heat").currentVisib ility = true;
alert(mySelection[n].images[0].graphicLayerOptions.graphicLayers.itemByName("Heat").curre ntVisibility);
but what I actually need is more like
mySelection[n].images[0].graphicLayerOptions.graphicLayerComps.itemByName("Heat").currentVisibility = true;
It seems a bit strange (or I am looking on the wrong places) but there is no way to access layer comps in Indesign.
Do I have to change the file in PhotoShop and save to get the result I need? Looks a bit strange that there isn't a more logical way then...
The reason I want to script this, is because when there are 100 PSD's on one page and they should al get the same Layer Comp... you have to do this manually for every image.
I like to use this feature to build texture-atlasses and have a dynamic result, but at this moment it would take at least 10 seconds for every picture... for 3 pages, and that for 7 files (and even more in the future).
If anybody has ever scripted something with LayerComps, please let me know. (and something like recording Actions in photoshop is equally usefull)
Otherwise I guess the Adobe programmers just didn't want to share this feature yet in CS5.5.
Maybe you are looking for
-
Check user entry in Customer Exit Variable in i_step2
Hi Folks, at the moment I'm facing a challenging problem. In an BW Query i have a Customer Exit defined as "not ready for Input" to catch the Variable in I_Step = 2 and fill by a certain algorithm. When i change the CE Variable to "Inputready", the u
-
LED Cinema Display 27 Random Loss of USB
I have a brand new 27" LED Cinema display connected via Mini Display Port to my 2006 Mac Pro with an ATI Radeon HD 5770 graphics card. The display's USB cable is connected to a USB port on the back of the Mac Pro. My keyboard is the newest Apple ex
-
Simple question from jsp newbie
Hi friends, I am learning jsp now. Reading documents and implementing simple applications. But i want to ask a question that is opposite to my logic. Now, i am a textfield control on jsp as textField1. I have created this control from Palette. in jav
-
Aperture 3 not syncing correctly to devices
Aperture 3 is not syncing correctly with my iPhone/iPad. All the albums sync, but they contain some images that arn't in the actual Aperture folders. This is very frustrating when I go to show someone my portfolio and images I dont want in the folder
-
Automated Document Type in MIRO
Hi, I woud like to populate document type ( Under Detail Tab ) as per customer specific ( based on Company & Transaction code ) whenever user hits MIRO transaction code. I am looking for BADI/ Exits by which I could change the document type as based