Skip to main content
compupix
Known Participant
January 21, 2023
質問

Copy Path

  • January 21, 2023
  • 返信数 2.
  • 1022 ビュー

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!

このトピックへの返信は締め切られました。

返信数 2

Legend
January 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

compupix
compupix作成者
Known Participant
January 6, 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.

compupix
compupix作成者
Known Participant
January 6, 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)
    }

 


Awesome! Thanks. 🙂

Stephen Marsh
Community Expert
Community Expert
January 21, 2023

Try this one from @Lumigraphics:

 

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

 

(edit: incorrect script code removed)

compupix
compupix作成者
Known Participant
January 21, 2023

Bridge gave me an error:

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'

 

 

Stephen Marsh
Community Expert
Community Expert
January 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.