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

Can I pass a variable (file pathway) to windows7 system clipboard?

Enthusiast ,
Jan 16, 2012 Jan 16, 2012

Copy link to clipboard

Copied

Every time I must correct an image I have to upload it to the net work with an inner app I must use. I use CS5.

I need to "paste" the place where the image is in the network (for example z:/abc/user/images/fegvfb.jpg ) and I have allready a saving code that has this variable already.

After I have saved the image, I must go to the system (windows7) where the image is on the network, and "copy" the file pathway and paste it into the app (I must use this app)

Because I manage to deal with hundreds images every day, I wonder if it is possible to copy to windows7 clipboard th image pathway I already have as a variable when I save any image.

If I manage to do that, I can go directly from photoshop to my app (avoiding go to windows system).

TOPICS
Actions and scripting

Views

978

Translate

Translate

Report

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

correct answers 1 Correct answer

Valorous Hero , Jan 17, 2012 Jan 17, 2012

You could do something like this ...

var str = "/z/SS12/Spinnaker.Women_3736/BURBERRY.BRIT/Photo/_v_10151022-BURBERRY. BRIT.3792285.62b.25000.TRENCH.Cotton/Photoshop Retouched/web";

var Drive = str.substr(1,1);

str= decodeURI(str).substr(2);

var cmd = Drive.toUpperCase()+':' +str.replace(/\//g,'\\') + '\\';

system( "echo " + cmd+ " | clip.exe");

Votes

Translate

Translate
Adobe
Valorous Hero ,
Jan 16, 2012 Jan 16, 2012

Copy link to clipboard

Copied

This will put the active documents path to the clipboard ....

system( "echo " + decodeURI(activeDocument.path.fsName) + " | clip.exe");

Votes

Translate

Translate

Report

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
Enthusiast ,
Jan 17, 2012 Jan 17, 2012

Copy link to clipboard

Copied

well, couldn't manage to convert this string:

/z/SS12/Spinnaker.Women_3736/BURBERRY.BRIT/Photo/_v_10151022-BURBERRY.BRIT.3792285.62b.25000.TRENCH.Cotton/Photoshop Retouched/web

to:

Z:\SS12\Spinnaker.Women_3736\BURBERRY.BRIT\Photo\_v_10151022-BURBERRY.BRIT.3792285.62b.25000.TRENCH.Cotton\Photoshop Retouched\web\

- pick my variable (it is a folder)

- change always at the begining    /z/   to   Z:\

- search and change any "/" caracter to "\"

- I will need to add another "\" at the end of the string so my app works and searches a folder "web"

- Then I can send it to clipboard

Votes

Translate

Translate

Report

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
Valorous Hero ,
Jan 17, 2012 Jan 17, 2012

Copy link to clipboard

Copied

You could do something like this ...

var str = "/z/SS12/Spinnaker.Women_3736/BURBERRY.BRIT/Photo/_v_10151022-BURBERRY. BRIT.3792285.62b.25000.TRENCH.Cotton/Photoshop Retouched/web";

var Drive = str.substr(1,1);

str= decodeURI(str).substr(2);

var cmd = Drive.toUpperCase()+':' +str.replace(/\//g,'\\') + '\\';

system( "echo " + cmd+ " | clip.exe");

Votes

Translate

Translate

Report

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
Enthusiast ,
Jan 17, 2012 Jan 17, 2012

Copy link to clipboard

Copied

  Thanks!

Votes

Translate

Translate

Report

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
Enthusiast ,
Jan 17, 2012 Jan 17, 2012

Copy link to clipboard

Copied

Hi again

My app gives me an error. It needs to have only this (example:)

Z:\SS12\Spinnaker.Women_3736\BURBERRY.BRIT\Photo\_v_10151022-BURBERRY. BRIT.3792285.62b.25000.TRENCH.Cotton\Photoshop Retouched\web\

When it copy the string to clipboard it ads 2 invisible caracters at the end:

1 - a space

2 - a paragraph

Can it be deleted?

Votes

Translate

Translate

Report

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
Valorous Hero ,
Jan 17, 2012 Jan 17, 2012

Copy link to clipboard

Copied

LATEST

Could you please try one of these...

//If a file spec
var file = File("/z/SS12/Spinnaker.Women_3736/BURBERRY.BRIT/Photo/_v_10151022-BURBERRY. BRIT.3792285.62b.25000.TRENCH.Cotton/Photoshop Retouched/web/fileName.jpg");
app.system("echo " + decodeURI(Folder(file.path).fsName) +"\\ | clip.exe");

//If folder spec
var folder = Folder("/z/SS12/Spinnaker.Women_3736/BURBERRY.BRIT/Photo/_v_10151022-BURBERRY. BRIT.3792285.62b.25000.TRENCH.Cotton/Photoshop Retouched/web");
app.system("echo " + decodeURI(folder.fsName) +"\\ | clip.exe");


I have tested both of these pasting the result from the clipboard into Windows Explorer and they both work. It does look as if a space is being added at the end but that would clip.exe adding this and cannot be removed.

Votes

Translate

Translate

Report

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