Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Copy Path

Participant ,
Jan 20, 2023 Jan 20, 2023

I have a script that used to copy the full path of a selected file. The script no longer works.

Adobe Bridge v 13.0.2.636

Script:

#target bridge
if( BridgeTalk.appName == "bridge" ) {
bridgePath = new MenuElement("command", "Path to Clipboard", "at the end of Thumbnail");
}
bridgePath.onSelect = function () {
pathToClipboard();
}
function pathToClipboard(){
var sels = app.document.selections;
app.system("echo "+decodeURI(sels[0].spec.fsName) +"|clip");
}

 

Script location:

C:\Users\{me}\AppData\Roaming\Adobe\Bridge 2023\Startup Scripts

 

Thanks!

TOPICS
How to , Problem or error , Scripting
915
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 21, 2023 Jan 21, 2023

Try this one from @Lumigraphics:

 

https://www.dropbox.com/sh/mg817g9a9ymbasi/AADTmXUVxmFfM58bcyYE7yiwa?dl=0

 

(edit: incorrect script code removed)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 21, 2023 Jan 21, 2023

Bridge gave me an error:

Untitled-1.jpg

So I updated to v 13.0.2.636 (the same version!)

It gives the same error:

'Line 31: #include "prefsReader.jsxinc" //shared prefs read code

File or folder does not exist'

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 21, 2023 Jan 21, 2023

Ah, it isn't a stand alone script, it relies on a missing preference file.

 

You will need to download the entire utility script pack from the link previously provided.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 22, 2023 Jan 22, 2023

This is only a valid script on Windows, the Mac uses the pasteboard. Use my script in the Utility Script Pack

https://www.dropbox.com/sh/mg817g9a9ymbasi/AADTmXUVxmFfM58bcyYE7yiwa?dl=0

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 06, 2024 Jan 06, 2024

I am unable to get copy full path with filename to work.

Does it work with the current version of Adobe Bridge? If yes, please give instructions on which files are needed and where to place them.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jan 06, 2024 Jan 06, 2024

If you only need a script to copy the file path, try this modification of your origninal script. It should work on Bridge 13 and 14 on Windows.

#target bridge
if( BridgeTalk.appName == "bridge" ) {
    bridgePath = new MenuElement("command", "Path to Clipboard", "at the end of Thumbnail");
    }

bridgePath.onSelect = function () {
    pathToClipboard();
    }

function pathToClipboard(){
        var sels = app.document.selections;
        app.document.copyTextToClipboard(sels[0].spec.fsName);
      //  Window.alert("File path copied to clipboard\n\n"+sels[0].spec.fsName)
    }

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 06, 2024 Jan 06, 2024

Awesome! Thanks. 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 07, 2024 Jan 07, 2024

It stopped working after I rebooted my computer. The script is still in place:

C:\Users\{me}\AppData\Roaming\Adobe\Bridge 2023\Startup Scripts\Bridge CC Copy Path.jsx

if( BridgeTalk.appName == "bridge" ) {
    bridgePath = new MenuElement("command", "Path to Clipboard", "at the end of Thumbnail");
    }

bridgePath.onSelect = function () {
    pathToClipboard();
    }

function pathToClipboard(){
        var sels = app.document.selections;
        app.document.copyTextToClipboard(sels[0].spec.fsName);
      //  Window.alert("File path copied to clipboard\n\n"+sels[0].spec.fsName)
    }

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 07, 2024 Jan 07, 2024
LATEST

So I had to save that script to ...\Bridge 2024 \Startup Scripts.

Now it works again. I don't know why it worked for a time yesterday.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines