[SOLVED] Color filter by custom columns -- is this possible?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
sj515064
Posts: 51
Joined: 21 Feb 2019 06:14

[SOLVED] Color filter by custom columns -- is this possible?

Post by sj515064 »

I have a custom column named "SVN status", which shows enumerations like "normal", "modified", "added", ..., etc. for each file.

I would like to have different colors for files with different values in the custom column "SVN status". For example, if a file is "modified", it is red. If it is "normal", it is green.

Is this possible?
Last edited by sj515064 on 08 Mar 2019 15:52, edited 1 time in total.

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

Re: Color filter by custom columns -- is this possible?

Post by highend »

Only if the entries in the custom column are representing tags.
One of my scripts helped you out? Please donate via Paypal

sj515064
Posts: 51
Joined: 21 Feb 2019 06:14

Re: Color filter by custom columns -- is this possible?

Post by sj515064 »

highend wrote: ↑04 Mar 2019 04:06 Only if the entries in the custom column are representing tags.
I see. Thanks :)

Off the topic: I found the return of SC "runret()" different from the one returned directly by CMD, especially when the return is multi-line. Possibly a bug there?

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

Re: Color filter by custom columns -- is this possible?

Post by highend »

I found the return of SC "runret()" different from the one returned directly by CMD, especially when the return is multi-line
Be more specific?
One of my scripts helped you out? Please donate via Paypal

sj515064
Posts: 51
Joined: 21 Feb 2019 06:14

Re: Color filter by custom columns -- is this possible?

Post by sj515064 »

highend wrote: ↑04 Mar 2019 06:26
I found the return of SC "runret()" different from the one returned directly by CMD, especially when the return is multi-line
Be more specific?
It's difficult for you to reproduce the result :) However, returns by "runret()" and CMD are really different.
I have attached the results below. Using a tool for text comparison it's easy to see the difference:

https://sjtueducn-my.sharepoint.com/:u: ... A?e=aznog1

This occurs mostly when there are CJK characters and multiple lines in the return.

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

Re: Color filter by custom columns -- is this possible?

Post by highend »

And the runret() part of the script looks like?...
One of my scripts helped you out? Please donate via Paypal

sj515064
Posts: 51
Joined: 21 Feb 2019 06:14

Re: Color filter by custom columns -- is this possible?

Post by sj515064 »

highend wrote: ↑04 Mar 2019 07:04 And the runret() part of the script looks like?...
It's like this:

Code: Select all

$P_SVN_Result = runret("svn status -v");
          //for debug
          writefile("return_by_runret.txt", $P_SVN_Result);

sj515064
Posts: 51
Joined: 21 Feb 2019 06:14

Re: Color filter by custom columns -- is this possible?

Post by sj515064 »

Just for reference for those who also come across the problem (return by runret() is not the same as that of CMD):

Root of the problem is difficult to locate. However, I did find a workaround:
1. Replace

Code: Select all

runret(command);
with

Code: Select all

run "cmd /c command ""<curpath>"" > ""<xydata>\temp\output.txt""", ,2,0;
(if "<curpath>" is not necessary simply remove it)
2. Read the output.txt in the temp folder:

Code: Select all

$Result = readfile("<xydata>\temp\output.txt");
3. Use $Result as you wish.
Last edited by sj515064 on 08 Mar 2019 13:44, edited 3 times in total.

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

Re: Color filter by custom columns -- is this possible?

Post by highend »

run "cmd /c command ""<curpath>"" > <xydata>\temp\output.txt", ,2,0;
You'll get into trouble if <xydata> is a path that contains a space!
One of my scripts helped you out? Please donate via Paypal

sj515064
Posts: 51
Joined: 21 Feb 2019 06:14

Re: Color filter by custom columns -- is this possible?

Post by sj515064 »

highend wrote: ↑08 Mar 2019 12:16 run "cmd /c command ""<curpath>"" > <xydata>\temp\output.txt", ,2,0;
You'll get into trouble if <xydata> is a path that contains a space!
Thanks for the alert :)

I'm a newbie in XY scripting. I think adding or removing some quotation marks will help to avoid the problem.
But I don't know how to do it :?:

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

Re: Color filter by custom columns -- is this possible?

Post by highend »

And looking at how it is done for <curpath> does not help? oO
One of my scripts helped you out? Please donate via Paypal

sj515064
Posts: 51
Joined: 21 Feb 2019 06:14

Re: Color filter by custom columns -- is this possible?

Post by sj515064 »

highend wrote: ↑08 Mar 2019 12:37 And looking at how it is done for <curpath> does not help? oO
I remember it now :) -- Paths with whitespace should be quoted, like this "PATH".

The post has been updated.

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

Re: Color filter by custom columns -- is this possible?

Post by highend »

You need to quote the full path, not only a part of it...
One of my scripts helped you out? Please donate via Paypal

sj515064
Posts: 51
Joined: 21 Feb 2019 06:14

Re: Color filter by custom columns -- is this possible?

Post by sj515064 »

highend wrote: ↑08 Mar 2019 13:22 You need to quote the full path, not only a part of it...

I finally figure it out:

It should be

Code: Select all

run "cmd /c command ""<curpath>"" > ""<xydata>\temp\output.txt", ,2,0;
rather than

Code: Select all

run "cmd /c command ""<curpath>"" > ""<xydata>""\temp\output.txt", ,2,0;
Thanks for the correction (again) :)

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

Re: Color filter by custom columns -- is this possible?

Post by highend »

run "cmd /c command ""<curpath>"" > ""<xydata>\temp\output.txt""", ,2,0;
One of my scripts helped you out? Please donate via Paypal

Post Reply