Skip to main content
Participating Frequently
Mar 20, 2014 4:53 PM UTC
Answered

Copy Filename to Clipboard

I'm looking for a script that will copy the filenames of files selected in Bridge CC to the clipboard. Does anyone have one?

I did read an old post that referred to one and had a script - but it gave an error, and I think it must have been for an older version of Bridge. Also, it didn't include the file extension, which I would want to do.

Thanks!

G

This topic is closed to new replies. Start a new post to keep the conversation going.
I have goneCorrect answer
Inspiring
Mar 20, 2014 5:59 PM UTC

There is no direct way of writing to the system clipboard unless you use an external library as can be be found at Paul's site  (Windows only).

http://www.ps-bridge-scripts.talktalk.net/

There are work-a-rounds see http://www.ps-scripts.com/bb/viewtopic.php?p=15322

The easy way is to write the information to a text file, here is an example of writing the filenames to a text file on the desktop.

The filename will be the same as the current folder name in bridge.

#target bridge

if (BridgeTalk.appName == "bridge"){

var FtoFiles = MenuElement.create( "command", "Filenames to file", "at the end of Tools");

}

FtoFiles.onSelect = function (){

var files = app.document.selections;

var fileNames = new Array();

for(var a in files){fileNames.push(decodeURI(files.spec.name));}

var folderName = decodeURI(Folder(app.document.presentationPath).name);

var f = new File(Folder.desktop + '/' + folderName + '.txt');

f.open('w');

f.write(fileNames.join('\n'));

f.close();

};

2 replies

I have goneCorrect answer
Inspiring
Mar 20, 2014 5:59 PM UTC

There is no direct way of writing to the system clipboard unless you use an external library as can be be found at Paul's site  (Windows only).

http://www.ps-bridge-scripts.talktalk.net/

There are work-a-rounds see http://www.ps-scripts.com/bb/viewtopic.php?p=15322

The easy way is to write the information to a text file, here is an example of writing the filenames to a text file on the desktop.

The filename will be the same as the current folder name in bridge.

#target bridge

if (BridgeTalk.appName == "bridge"){

var FtoFiles = MenuElement.create( "command", "Filenames to file", "at the end of Tools");

}

FtoFiles.onSelect = function (){

var files = app.document.selections;

var fileNames = new Array();

for(var a in files){fileNames.push(decodeURI(files.spec.name));}

var folderName = decodeURI(Folder(app.document.presentationPath).name);

var f = new File(Folder.desktop + '/' + folderName + '.txt');

f.open('w');

f.write(fileNames.join('\n'));

f.close();

};

Participating Frequently
Mar 20, 2014 6:28 PM UTC

Thanks Philip!

I appreciate the links, and especially the script - it saves me considerable work!

G

Translate