Toggle floating preview script help

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
fogg
Posts: 32
Joined: 15 Jul 2014 16:13
Location: Going around the World

Re: Toggle floating preview script help

Post by fogg »

Thank you everyone!!
SammaySarkar wrote:Well,
fogg wrote:select one file and floating preview and open this file in notepad.
I'm not exactly sure what's the purpose of the script: opening the same file in the FP and notepad? What does this accomplish? :eh:
Actually script is not full complete. I am wanting to view 1 png and open 1 txt in other folder. I have some scans page in png, and putting texts in same names txt files.

As example i have scan png such as 0001.png,0002.png,0003.png,0004.png.....0056.png etc... in one folder E:\doc-x43\scan\ and i have 0001.txt,0002.txt,0003.txt,0004.txt etc... in other folder E:\doc-x43\text\. I want script opens 0001.png in floting preview and opens 0001.txt in notepad and as same again 0002.png and 0002.txt etc.

I try adjust your helping script like here

Code: Select all

  $ITEMS = listpane(, "*.png", 1); // |-separated list of only pdf files in list.
  foreach ($ITEM, $ITEMS) {        // walk thru each item on the $ITEMS list
    selectitems($ITEM, 2);         // select $ITEM.  unlike sel, selectitems can select by full path
    if (get("#178")==0) { #178; }  // open FP.       get("#178")==0 means floating preview is NOT active. #178 opens it.
    
    $TEXT = replace($ITEM, "png", "txt");
    run "notepad ""$TEXT""",,1,1;  // open notepad.  note the doublequotes around $ITEM. the fullpath can have spaces
   }
   #178;                           // since FP is sure to be open at this point, this will toggle it off

How to script now? Please help? opening same names txt in notepad? :cry:
s404:signature not found.

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

Re: Toggle floating preview script help

Post by highend »

Code: Select all

$TEXT = replace(replace($ITEM, "png", "txt"), "\scan", "\text");
One of my scripts helped you out? Please donate via Paypal

fogg
Posts: 32
Joined: 15 Jul 2014 16:13
Location: Going around the World

Re: Toggle floating preview script help

Post by fogg »

Code: Select all

  $ITEMS = listpane(, "*.png", 1); // |-separated list of only pdf files in list.
  foreach ($ITEM, $ITEMS) {        // walk thru each item on the $ITEMS list
    selectitems($ITEM, 2);         // select $ITEM.  unlike sel, selectitems can select by full path
    if (get("#178")==0) { #178; }  // open FP.       get("#178")==0 means floating preview is NOT active. #178 opens it.
   
    $TEXT = replace(replace($ITEM, "png", "txt"), "\scan", "\text");
    run "notepad ""$TEXT""",,1,1;  // open notepad.  note the doublequotes around $ITEM. the fullpath can have spaces
   }
   #178;                           // since FP is sure to be open at this point, this will toggle it off

THANK YOU SO MUCH!!! :appl: :appl: :appl: :appl:
script works in other doc scan folders also!!! :biggrin: :biggrin: :biggrin:
s404:signature not found.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Toggle floating preview script help

Post by bdeshi »

I feel this make it more foolproof. 8)

Code: Select all

    $TEXT = regexreplace(<curpath>, '\\scan$', '\text').'\'.gpc($ITEM,'base').'.txt';
I mean what if fog's scanned projects are moved to a dedicated E:\scan\ (or similar) folder.

Also, @fogg I really hope you used OCR to generate the txts... :maf:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

fogg
Posts: 32
Joined: 15 Jul 2014 16:13
Location: Going around the World

Re: Toggle floating preview script help

Post by fogg »

Hello, what is pattern for includeing *.jpg scans for floating preview?
s404:signature not found.

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

Re: Toggle floating preview script help

Post by highend »

Replace

Code: Select all

$ITEMS = listpane(, "*.png", 1);
with

Code: Select all

$ITEMS = quicksearch("/nf /types=png;jpg", , "|");
but ofc you need to edit your
$TEXT
stuff as well, depending on the extension...
One of my scripts helped you out? Please donate via Paypal

fogg
Posts: 32
Joined: 15 Jul 2014 16:13
Location: Going around the World

Re: Toggle floating preview script help

Post by fogg »

Thank you!!! My script is now like this -
It's works beautifully!!!

Code: Select all

  $ITEMS = quicksearch("/nf /types=png;jpg", , "|");
  foreach ($ITEM, $ITEMS) {        // walk thru each item on the $ITEMS list
    selectitems($ITEM, 2);         // select $ITEM.  unlike sel, selectitems can select by full path
    if (get("#178")==0) { #178; }  // open FP.       get("#178")==0 means floating preview is NOT active. #178 opens it.
   
    $TEXT = replace(replacelist($ITEM, "png,jpg", "txt,txt", ","), "\scan", "\text");
    run "notepad ""$TEXT""",,1,1;  // open notepad.  note the doublequotes around $ITEM. the fullpath can have spaces
   }
   #178;                           // since FP is sure to be open at this point, this will toggle it off

s404:signature not found.

Post Reply