Copy link to clipboard
Copied
I absolutley do not understand why the functionality of copying and pasting guides to other documents was removed/moved? One of the most basically needed features of a program has to be messed with. Who's function in the script did it mess with?? I cant find an answer on the web due to multiple changes between versions but documentation has not been updated. Im using 24.7.0. Why not have a simple checkbox option for the current guides in the first document to carry over to any sub-sequent documents after it?
Have you searched the forum?
COPY GUIDES:
/* https://www.reflections-ibs.com/media/1241/guides-copy.jsx */
#target photoshop
main();
function main(){
if(Number(app.version.match(/\d+/)) <12) return;
if(!documents.length) return;
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
setGuides();
app.preferences.rulerUnits = startRulerUnits;
function setGuides(){
var guides = app.activeDocument.guides;
if(guides.length == 0){
alert("N
...
Copy link to clipboard
Copied
I absolutley do not understand why the functionality of copying and pasting guides to other documents was removed/moved?
In which version was this a (default) feature?
What is your actual problem?
I can’t find Paul Riggott’s Script on Guide-transfer etc., maybe this can help:
// take guides from active document and add them to other open documents after removing their existing guides;
// 2013, use at your own risk;
#target photoshop
if (app.documents.length > 0 && app.activeDocument.guides.length > 0) {main()};
////// function //////
function main () {
// set to pixels;
var myDocument = app.activeDocument;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
// collect guides;
var theArray = new Array;
for (var m = 0; m < myDocument.guides.length; m++) {
theArray.push([myDocument.guides[m].coordinate, myDocument.guides[m].direction])
};
app.preferences.rulerUnits = originalRulerUnits;
// get all open documents;
var theDocs = app.documents;
for (var o = 0; o < app.documents.length; o++) {
var thisDocument = app.documents[o];
// proceed if not original document;
if (thisDocument != myDocument) {
app.activeDocument = thisDocument;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
// remove existing guides;
for (var n = thisDocument.guides.length-1; n >=0; n--) {
thisDocument.guides[n].remove()
};
// add guides;
for (var p = 0; p < theArray.length; p++) {
thisDocument.guides.add(theArray[p][1], theArray[p][0]);
};
app.preferences.rulerUnits = originalRulerUnits;
};
};
};
Copy link to clipboard
Copied
As far as which version was it removed: While looking for an option to copy guides through a Google search, I see Adobe Support referring to a 2015 version and others for which those choices are not there and nowhere to be found in the latest version. This leads me to believe its been removed. My problem is needing the ability to copy guides from one document to another in order to keep alignment between diffuse, metallic, roughness, and ao maps. I would think that this is a basic need for many artists to have the ability to align between documents. Id rather not have to copy and past my textures in and out of one document just to check alignment leading to unforseen errors. (Unless Im missing a new way of doing this). I did see this script but it seems funny to have to resort to creating ,implementing, and troubleshooting scripts for a basic function that was removed/moved.
Copy link to clipboard
Copied
I cannot remember that this was a default option in any Photoshop version.
Please post the link to the article you mentioned.
I did see this script but it seems funny to have to resort to creating ,implementing, and troubleshooting scripts for a basic function that was removed/moved.
If you don’t want to use Photoshop’s customisation options (Actions, Scripts, Keyboard Shortcuts, …) then you would appear to be stuck with its default behaviour. It’s your own choice.
If you want to post a Feature Request please start a new thread and mark it »Idea« instead of »Discussion«.
Copy link to clipboard
Copied
Wow, its amazing that I cant find it either now, but the path to copying the guides was File > Scripts > Copy Guides. Im using a workaround now though by using one document for all maps. Diffuse, metallic, roughness, ao, and normal are on separate layers and Im just exporting them with unique names instead. Thanks for looking into it though.
Copy link to clipboard
Copied
Just realized that this might have been from a custom script.
Copy link to clipboard
Copied
Yes, it must have been a custom script, and our amazing volunteer scripters might possibly write another one for you, or the one CP posted might work.
This has never been part of Photoshop, but could always be done in InDesign and Illustrator.
Jane
Copy link to clipboard
Copied
Did you figure out a fix. I don't know how to do anything with html etc. I sure could use a video or some help. Yes why was this removed !! Crying softly!!
Copy link to clipboard
Copied
I figured it out thanks to this video here https://www.youtube.com/watch?v=ua9R6ggF5bY I have the files he used in this video if anyone is desperate for them.
Copy link to clipboard
Copied
But what if the zero of the ruler does not match in the documents?
)
Copy link to clipboard
Copied
But what if the zero of the ruler does not match in the documents?
)
By @r-bin
Good point!
I haven't tested this... But if this was a problem (I'm guessing that it is, otherwise you wouldn't have mentioned it), one can always reset the origin point with additional code:
Copy link to clipboard
Copied
Have you searched the forum?
COPY GUIDES:
/* https://www.reflections-ibs.com/media/1241/guides-copy.jsx */
#target photoshop
main();
function main(){
if(Number(app.version.match(/\d+/)) <12) return;
if(!documents.length) return;
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
setGuides();
app.preferences.rulerUnits = startRulerUnits;
function setGuides(){
var guides = app.activeDocument.guides;
if(guides.length == 0){
alert("No guides exist");
return;
}
var gH = '';
var gV = '';
for( var g = 0; g < guides.length; g++ ){
if(guides[g].direction.toString() == 'Direction.HORIZONTAL'){
gH+=(parseInt(guides[g].coordinate.value));
gH+=',';
}else{
gV+=(parseInt(guides[g].coordinate.value));
gV+=','
}
}
gH=gH.replace(/,$/,'');
gV=gV.replace(/,$/,'');
currentGuides = 'Layer Guides' + "�" + gH + "�" + gV;
var desc2 = new ActionDescriptor();
desc2.putString(0, currentGuides.toSource());
app.putCustomOptions('7a301ec0-afde-11e1-afa6-0800200c9a66', desc2, true );
}
function displayGuides(){
try{
var desc1 = app.getCustomOptions('7a301ec0-afde-11e1-afa6-0800200c9a66');
var layerGuides = eval(desc1.getString(0));
}catch(e){return;}
clearGuides();
var ar1 = layerGuides.toString().split('�');
var Hor = ar1[1].toString().split(',');
var Ver = ar1[2].toString().split(',');
for(var H in Hor){
activeDocument.guides.add(Direction.HORIZONTAL,new UnitValue(Number(Hor[H]),'px'));
}
for(var V in Ver){
activeDocument.guides.add(Direction.VERTICAL,new UnitValue(Number(Ver[V]),'px'));
}
}
}
function clearGuides() {
var id556 = charIDToTypeID( "Dlt " );
var desc102 = new ActionDescriptor();
var id557 = charIDToTypeID( "null" );
var ref70 = new ActionReference();
var id558 = charIDToTypeID( "Gd " );
var id559 = charIDToTypeID( "Ordn" );
var id560 = charIDToTypeID( "Al " );
ref70.putEnumerated( id558, id559, id560 );
desc102.putReference( id557, ref70 );
executeAction( id556, desc102, DialogModes.NO );
};
PASTE GUIDES:
/* https://www.reflections-ibs.com/media/1242/guides-paste.jsx */
#target photoshop
main();
function main(){
if(Number(app.version.match(/\d+/)) <12) return;
if(!documents.length) return;
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
displayGuides();
app.preferences.rulerUnits = startRulerUnits;
function setGuides(){
var guides = app.activeDocument.guides;
if(guides.length == 0){
alert("No guides exist");
return;
}
var gH = '';
var gV = '';
for( var g = 0; g < guides.length; g++ ){
if(guides[g].direction.toString() == 'Direction.HORIZONTAL'){
gH+=(parseInt(guides[g].coordinate.value));
gH+=',';
}else{
gV+=(parseInt(guides[g].coordinate.value));
gV+=','
}
}
gH=gH.replace(/,$/,'');
gV=gV.replace(/,$/,'');
currentGuides = 'Layer Guides' + "�" + gH + "�" + gV;
var desc2 = new ActionDescriptor();
desc2.putString(0, currentGuides.toSource());
app.putCustomOptions('7a301ec0-afde-11e1-afa6-0800200c9a66', desc2, true );
}
function displayGuides(){
try{
var desc1 = app.getCustomOptions('7a301ec0-afde-11e1-afa6-0800200c9a66');
var layerGuides = eval(desc1.getString(0));
}catch(e){return;}
clearGuides();
var ar1 = layerGuides.toString().split('�');
var Hor = ar1[1].toString().split(',');
var Ver = ar1[2].toString().split(',');
for(var H in Hor){
activeDocument.guides.add(Direction.HORIZONTAL,new UnitValue(Number(Hor[H]),'px'));
}
for(var V in Ver){
activeDocument.guides.add(Direction.VERTICAL,new UnitValue(Number(Ver[V]),'px'));
}
}
}
function clearGuides() {
var id556 = charIDToTypeID( "Dlt " );
var desc102 = new ActionDescriptor();
var id557 = charIDToTypeID( "null" );
var ref70 = new ActionReference();
var id558 = charIDToTypeID( "Gd " );
var id559 = charIDToTypeID( "Ordn" );
var id560 = charIDToTypeID( "Al " );
ref70.putEnumerated( id558, id559, id560 );
desc102.putReference( id557, ref70 );
executeAction( id556, desc102, DialogModes.NO );
};
Here's one for all docs that match the source doc's dimensions:
Another one:
Copy link to clipboard
Copied
Did the script come from here?
Copy link to clipboard
Copied
I have the script files he used for that video thank Heavens I managed to move them over into 2024.
Copy link to clipboard
Copied
Note, there are issues running the scripts in v2024, as discussed here: