Copy link to clipboard
Copied
I don't know if this is somethig that's possible. But at my work I have a lot of survey photos I have to place in with my artwork. Usually the file names of the photos have information that I have to re-type. So say there's a photo of an empty patch of land, the file name will be named something like 'sign placed here left of hydrant'. I have to go and re-type that. I'm wondering if it's possible to create a script that can just generate that text? Thanks for any help.
You may be able to use my addLinkedFileNames.jsx script, which was written for similar purposes.
Copy link to clipboard
Copied
You may be able to use my addLinkedFileNames.jsx script, which was written for similar purposes.
Copy link to clipboard
Copied
Perfect! That's exactly what I needed. Thank you so much.
Copy link to clipboard
Copied
You could pimp it a bit. Let it place it automatically at the top left. Save you editing 🙂
Data is the filename, obj is linkedItem, pos is position of linked object. But i use different method for that inside the function. This one centers it at the top. Please Noet, pickedColor is defined outside this function. So that would need something else
function placeTextLabel(data, obj, pos){
var docRef = app.activeDocument;
// obj.selected = true;
// alert(docRef.activeLayer.visible)
returnVisibleLayer(docRef.layers.length);
var pathRef = obj;
//Create a textFrame and set its contents to areaMessage.
var areaLabel = app.activeDocument.activeLayer.textFrames.add();
areaLabel.contents = data; //.join("\n");
for(i=0;i<areaLabel.paragraphs.length;i++){
areaLabel.paragraphs[i].justification=Justification.LEFT;
areaLabel.paragraphs[i].fillColor = pickedColor;
}
// areaLabel.position = pos;
//Position areaLabel at the center of the selected path.
areaLabel.top = pathRef.top+areaLabel.height+4;//-pathRef.height/2+areaLabel.height/2;
areaLabel.left = pathRef.left+pathRef.width/2-areaLabel.width/2;
}
EDIT
Actually it does have it, though it works different i see. I places it over the image.
If you replace lines 65-67 with this, it will move it to the top of the image. No need to manually adjust it then
tf.top = obj.top+tf.height+4;
tf.left = obj.left+obj.width/2-tf.width/2;
Result old vs newOld method > text is over image
New method > text is at top of image
Copy link to clipboard
Copied
Certainly the caption above the top of the image is easier to see 👍 I couldn't find my chat from six months ago with the designer about this script. He didn't seem to need the positioning. The text in the center of the image is definitely not confusing as to what it refers to 🙂 The GIF is old, in the latest version of the script I automatically selected all created text, just so the user can move it where they want, or leave it in the center.
Copy link to clipboard
Copied
Released a new script ShowObjectNames, which got a dialog with custom caption placement and support for the names of any selected objects. addLinkedFileNames.jsx is deprecated