Ghost Filter - removal of filters
Posted: 28 Sep 2019 21:18
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.
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');