Lable color

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
shamsudeen
Posts: 64
Joined: 05 May 2012 06:58

Lable color

Post by shamsudeen »

Hi all,
i have added a script to open jpeg file Open with photoshop here is the script "Bro Highend posted this script"

$photoshop = "C:\Program Files\Adobe\Photoshop\Photoshop.exe";
run """$photoshop ""<curitem>""";
tag "Red";

i need some more script for my work that is when i open first time the Jpeg file will be labeled in Red color likewise when i open this same file again it must label with red and blue i will open the file three times . your help will be appreciated .

Thank you
Shamsudee S

PeterH
Posts: 2829
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Lable color

Post by PeterH »

Just one thing: there are async double quotes!

After first substitution of outer quotes the rest will be:
"$photoshop "<curitem>"
I don't think this is intended?

shamsudeen
Posts: 64
Joined: 05 May 2012 06:58

Re: Lable color

Post by shamsudeen »

PeterH wrote:Just one thing: there are async double quotes!

After first substitution of outer quotes the rest will be:
"$photoshop "<curitem>"
I don't think this is intended?
Thanks for your reply, i needed to open a Jpeg file three times here i need to know how many times i have used or worked in the Jpeg file, whether it is twice or once or thrice

Thank you
Shamsudeen S

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Lable color

Post by Marco »

I think it's impossible. How can you discern if a file has been modified once or twice or thrice?
Maybe storing the modified date in a database, but seems impractical and not fully reliable.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

highend
Posts: 14956
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Lable color

Post by highend »

Sure it can be done.

Just read the tags before you set one.

No tags = never opened
Only red = opened once
Red & blue = opened twice
Red & blue & green = three times

Set the tags accordingly.

He just asked for "opened", not modified :)
As an alternative, the comment could be modified...
One of my scripts helped you out? Please donate via Paypal

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Lable color

Post by Marco »

Assuming he always uses the script to load/open such files, right?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

shamsudeen
Posts: 64
Joined: 05 May 2012 06:58

Re: Lable color

Post by shamsudeen »

highend wrote:Sure it can be done.

Just read the tags before you set one.

No tags = never opened
Only red = opened once
Red & blue = opened twice
Red & blue & green = three times

Set the tags accordingly.

He just asked for "opened", not modified :)
As an alternative, the comment could be modified...
You are right brother, how to do that in user defined commands open with photoshop using the same script.

Thank you

highend
Posts: 14956
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Lable color

Post by highend »

Labels are exclusive, so you can't colorize a file with more than one color.

So:

Code: Select all

    $photoshop = "C:\Program Files\Adobe\Photoshop\Photoshop.exe";
    run """$photoshop"" ""<curitem>""";
    $label = report("{Label}", "<curitem>");
    if($label == "") {
        tag "Green";
    } elseif($label == "Green") {
        tag "Orange";
    } elseif($label == "Orange") {
        tag "Red";
    }
Depending on how often you've executed that script on a specific file, it will set the label to green, orange and on the third time, red.

@PeterH
Missing double quotes fixed.
One of my scripts helped you out? Please donate via Paypal

PeterH
Posts: 2829
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Lable color

Post by PeterH »

highend wrote:@PeterH
Missing double quotes fixed.
:biggrin: :appl:

shamsudeen
Posts: 64
Joined: 05 May 2012 06:58

Re: Lable color

Post by shamsudeen »

highend wrote:Labels are exclusive, so you can't colorize a file with more than one color.

So:

Code: Select all

    $photoshop = "C:\Program Files\Adobe\Photoshop\Photoshop.exe";
    run """$photoshop"" ""<curitem>""";
    $label = report("{Label}", "<curitem>");
    if($label == "") {
        tag "Green";
    } elseif($label == "Green") {
        tag "Orange";
    } elseif($label == "Orange") {
        tag "Red";
    }
Depending on how often you've executed that script on a specific file, it will set the label to green, orange and on the third time, red.

@PeterH
Missing double quotes fixed.
it worked well. thank you brother

Post Reply