Ghost Filter - removal of filters

Features wanted...
Post Reply
klownboy
Posts: 4406
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Ghost Filter - removal of filters

Post by klownboy »

I was using SC ghost in a script to hide images that were not a particular aspect ratio (e.g. 16:9) such that I would only see displayed those images that are AR 16:9. I did that by quicksearching the files that were not 16:9, selecting those files, and then ghosting those images. I found that when you end up with a very long list of files, the unghosting could take abnormally long even resulting in XY going unresponsive and stating so in the title bar. I believe this is clearly due to the very long list of individual files in the ghost filter. The actually ghosting of the files was relatively quick.

I ended up putting in the script a way to delete the ghost file listing first and then remove the ghost filter (see the script). That way the unghosting process ended quickly.

I made up a quick similar but unrelated script for you to test the ghosting/unghosting process below. To test you need to:
- copy about 200 jpg images to a temp folder
- copy about 100 non-image files to the same folder
- put the folder in a large thumbnail mode
- make that folder the current folder and run the little script below select JPG from the menu.
- note how long it takes to un-ghost the list using the ghost toolbar button.
- if you use the menu item in the script (Ghost Filter Off) to un-ghost, it happens quickly since the ghost edit listing is first deleted before filter removal.

Would it be possible to improve this process? Could you have a flag for SC ghost which could be used to delete any existing ghost filters (i.e., clear the Ghost Filter edit box). Hopefully it could be combined or performed prior to removal of the current ghost filter. Thanks.

Code: Select all

"         HIDE IMAGE TYPE|:cfi";
-
"   ●   JPG";
   sub _type;
"   ●   GIF";
   sub _type;
"   ●   PNG";
   sub _type;
-
"Ghost Filter off";
	sendkeys '^a{Del}^{Enter}';#499;
	ghost(, 0);
	end 1;

"_type";
	$image_type = substr(caller("caption"),7,,);
	if(exists(<curitem>) == 2) {$path = <curitem>;} else {$path = <curpath>;}
	$images = quicksearch("* /types=jpg;gif;bmp /n",,"|");
	end gettoken($images, "count", "|") < 1, "There are no jpg,gif, or bmp images in this folder.";
	$selected = quicksearch("*.$image_type",,"|");   //$selected = quicksearch("* /exclfile=*.$image_type",,"|");
	selectitems $selected;
	ghost($selected, '1');

jupe
Posts: 3296
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Ghost Filter - removal of filters

Post by jupe »

FYI you can empty the ghost filter and turn it off in 1 step like this:

Code: Select all

ghost("", 0);
or just empty it, keeping current state:

Code: Select all

ghost("");

klownboy
Posts: 4406
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: Ghost Filter - removal of filters

Post by klownboy »

Thank you Jupe. I didn't realize that you could specify a "" for the pattern and it would empty the ghost filter. Though it makes perfect sense, there's nothing in the pattern field help that clearly indicates "" will clear the Ghost Filter. To clarify maybe Don should tweak the help as below. I suppose specifying "" for a pattern though is probably typical to clear filters.

Code: Select all

patterns (optional) List of wildcard patterns separated by |.
missing: keep current patterns
else: set new patterns 
"" clears filter
ghost("", 0) would also make a good example.

It does look like in this case (for a huge listing of ghost filters), I'm tied to using ghost("", 0) in a script to clear the listing and remove the filter because if I simple hit the ghost toolbar button it comes close to locking up XY for a time.

:) Thanks again Jupe. :tup:

admin
Site Admin
Posts: 65185
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Ghost Filter - removal of filters

Post by admin »

Ok, updated the help.

Post Reply