Copy link names - script not doing exactly what I want
I am trying to create a script that will copy the filenames into a string of text separating the text with " || "
This is a technical reason I need all linked files in a single line of text separated this way
For example links panel shows
Link 1.ai
Link 2.ai
Link 3.eps
and I need them in a single line as "Link 1.ai || Link 2.ai || Link 3.eps" etc.
I have it kinda working but can't figure it out it's driving me nuts.
I have this but it copies the text frame instead of the text.
I can't figure out how to get just the text out of the text frame to the clipboard.
Everything I've tried results in an error
// Get all linked images in active document
var linkedImages = app.activeDocument.links;
// Loop through each image and add its filename to filenames array
var filenames = [];
for (var i = 0; i < linkedImages.length; i++) {
filenames.push(linkedImages[i].name);
}
// Join filenames array with " || " separator
var joinedFilenames = filenames.join(" || ");
// Create a temporary text frame to copy the text to
var tempTextFrame = app.activeDocument.pages[0].textFrames.add({
geometricBounds: [0, 0, 10, 10]
});
// Set the contents of the text frame to the joined filenames
tempTextFrame.contents = joinedFilenames;
// Select the text in the temporary text frame
tempTextFrame.select();
// Copy the text to the clipboard
app.copy();
// Delete the temporary text frame
tempTextFrame.remove();
Any help?

