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

reveal in explorer js

Explorer ,
Nov 07, 2024 Nov 07, 2024

Copy link to clipboard

Copied

Is it possible to use the "Reveal in Explorer" function using jsx? After using it, I want it to appear correctly in the image I am opening in Photoshop. Thank you, have a good day everyone

TOPICS
Actions and scripting , Windows

Views

433

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

People's Champ , Nov 08, 2024 Nov 08, 2024

Maybe I understood what you want

 

var the_name = activeDocument.name;

var files = activeDocument.path.getFiles();

files.sort(sort_func);

function sort_func(a, b) 
    {
    // Sorting will be alphabetical. 
    // It may differ from the one set in the explorer, especially for names with numbers.
    // For exact matching of sorting, you need to write another sorting function. 
    // Google will help you. )

    if (a > b) return 1;
    else if (a < b) return -1;
    else return 0;
    }

// h
...

Votes

Translate

Translate
Adobe
Community Expert ,
Nov 07, 2024 Nov 07, 2024

Copy link to clipboard

Copied

@trường_1768 

 

Set a variable to the Folder object, and then you can use .execute() to open the folder in either Windows Explorer or the Finder on the Mac.

 

var theFolder = Folder(app.activeDocument.path);
theFolder.execute();

 

Or just skip the variable:

 

Folder(app.activeDocument.path).execute();

 

I don't know how to have the file selected in Explorer, that would probably take some extra scripting to call on local operating system commands.

 

It is possible when calling Adobe Bridge:

 

 

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
Explorer ,
Nov 07, 2024 Nov 07, 2024

Copy link to clipboard

Copied

this is the answer i was looking for. But I still thank you for your help. Wish you a good day

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
People's Champ ,
Nov 07, 2024 Nov 07, 2024

Copy link to clipboard

Copied

 

for windows

var cmd = "explorer /select," + activeDocument.fullName.fsName;
system(cmd);

 

May not work with non-English names.

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
Explorer ,
Nov 07, 2024 Nov 07, 2024

Copy link to clipboard

Copied

Thank you. This is a very great answer. Exactly what I need, thank you again. Wish you a good day

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
Explorer ,
Nov 07, 2024 Nov 07, 2024

Copy link to clipboard

Copied

Can you help me with a code so I can open the image to the right of the currently selected image (ie Apple TV+-10 image) thank you

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
Explorer ,
Nov 07, 2024 Nov 07, 2024

Copy link to clipboard

Copied

I want to use the ''reveal in explorer'' function so I can open the next image

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
Community Expert ,
Nov 07, 2024 Nov 07, 2024

Copy link to clipboard

Copied

quote

I want to use the ''reveal in explorer'' function so I can open the next image

 

Can you help me with a code so I can open the image to the right of the currently selected image (ie Apple TV+-10 image) thank you


By @trường_1768

 

That's very literal of how a human would manually do it and not how one would generally do things via scripting.

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-open-a-number-of-images-but-on...

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/how-to-stop-action-to-use-healing-bru...

 

 

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
Explorer ,
Nov 08, 2024 Nov 08, 2024

Copy link to clipboard

Copied

awesome genius minds, thats what i was looking for all along. but when i run the script i want it to open the image next to it in photoshop, can you help me with that?

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
Explorer ,
Nov 08, 2024 Nov 08, 2024

Copy link to clipboard

Copied

sorry i am a foreigner so it may be difficult for you to understand. i want after running the script above to transfer to BR and i want to open the image next to the image when i run the script in PTS

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
People's Champ ,
Nov 08, 2024 Nov 08, 2024

Copy link to clipboard

Copied

Maybe I understood what you want

 

var the_name = activeDocument.name;

var files = activeDocument.path.getFiles();

files.sort(sort_func);

function sort_func(a, b) 
    {
    // Sorting will be alphabetical. 
    // It may differ from the one set in the explorer, especially for names with numbers.
    // For exact matching of sorting, you need to write another sorting function. 
    // Google will help you. )

    if (a > b) return 1;
    else if (a < b) return -1;
    else return 0;
    }

// here you can close activeDocument
// activeDocument.close(SaveOptions.DONOTSAVECHANGES);


for (var i = 0; i < files.length; i++)
    {
    if (files[i].name.toLowerCase() == the_name.toLowerCase())
        {
        if (i != files.length-1) 
            {
            open(files[i+1]);
            break;
            }    
        }
    }

if (i == files.length) alert("it was the last file");

 

 

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
Explorer ,
Nov 08, 2024 Nov 08, 2024

Copy link to clipboard

Copied

thank you. that's all i wanted. thank you for that, it will help my work a lot. have a nice day

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
Community Expert ,
Nov 08, 2024 Nov 08, 2024

Copy link to clipboard

Copied

LATEST

I'll mark r-bin's reply as the correct answer for you.

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
Community Expert ,
Nov 08, 2024 Nov 08, 2024

Copy link to clipboard

Copied

@trường_1768 

 

Rather than telling us what steps you think you would like to do, perhaps just describe the process, the actual task. There may be a different way to the same result.

 

Such as:

 

"From a single folder, I would like to batch automate combining two alphabetically sorting files into a layered PSD file".

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/script-to-automate-load-files-into-st...

 

 

 

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
Explorer ,
Nov 08, 2024 Nov 08, 2024

Copy link to clipboard

Copied

yes. thank you. maybe because of the language barrier so my explanation is a bit confusing. but everything is resolved, maybe it will help the work for the company I am working for. thank you again

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
Community Expert ,
Nov 08, 2024 Nov 08, 2024

Copy link to clipboard

Copied

OK, please mark the replies that helped as a correct answer.

 

If you need further help, perhaps post in your native language and we can use translation software.

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