Windows Quick Browser(Updated!!)

By Gex on Feb 18, 2006

Quick browser is script which lets u browse your computer and do the basic operation on file,folders. load to your remotes (alt + r)
then choose browser from menubar.

MENU menubar {
  File/Folder Browser {
    if (!$dialog(browser)) dialog -m browser browser
  }
}
dialog props {
  title "Folder Properties"
  size -1 -1 113 69
  option dbu
  text "Folder Name:", 1, 5 9 31 8
  edit "", 2, 46 8 62 10, read autohs
  text "Location:", 3, 5 21 25 8
  box "", 5, 1 30 110 6
  text "Size:", 6, 5 42 25 8
  text "", 7, 46 42 25 8
  text "Files:", 8, 5 53 25 8
  text "", 9, 46 54 25 8
  edit "", 4, 46 18 62 10, read autohs
}
dialog props2 {
  title "File Properties"
  size -1 -1 113 54
  option dbu
  text "File Name:", 1, 5 9 31 8
  edit "", 2, 46 8 62 10, read autohs
  text "Location:", 3, 5 21 25 8
  box "", 5, 1 30 110 6
  text "Size:", 6, 5 42 25 8
  text "", 7, 46 42 25 8
  edit "", 4, 46 18 62 10, read autohs
}
dialog browser {
  title "Windows Quick Browser"
  size -1 -1 333 173
  option dbu
  combo 1, 107 9 60 50, size drop
  list 2, 107 33 218 101, size
  box "Central", 3, 102 1 228 137
  button "Copy", 5, 108 152 31 12
  button "Paste", 6, 172 152 33 12
  button "Cut", 7, 139 152 33 12
  box "", 8, 105 145 102 23
  button "Rename", 4, 237 152 28 12
  button "Delete", 9, 265 152 28 12
  button "Properties", 10, 293 152 31 12
  box "", 11, 209 145 117 23
  button "Run", 12, 211 152 26 12
  text "Drive Letter", 13, 176 10 43 8, disable
  box "Quick Control", 14, 102 139 228 33
  edit "", 15, 107 22 197 10, read
  button "Go to", 16, 306 22 17 9
  box "Image Preview", 19, 2 120 99 52
  box "Text Preview", 18, 2 1 99 119
  edit "", 17, 4 9 93 106, read multi return vsbar
  icon 20, 16 132 66 35
  text "", 21, 8 162 0 8, center
  edit "NA..........", 22, 25 141 50 19, read
}

on *:dialog:browser:init:* {
  var %x 1
  while (%x < $disk(0)) {
    did -a browser 1 $disk(%x).path
    inc %x
  }
}
on *:dialog:browser:sclick:1 {
  did -ra browser 15 $did(1).seltext
  did -r browser 2
  var %x $finddir($did(1).seltext,*,0,1,did -a browser 2 < $+ $nopath($1-) $+ >) | unset %x
  var %x $findfile($did(1).seltext,*,0,1,did -a browser 2  $nopath($1-))
}
on *:dialog:browser:dclick:2 {

  if ($did(2).seltext != <>) {
    if (!$isfile($did(15) $+ $did(2).seltext)) {
      did -a browser 15 $gettok($gettok($did(2).seltext,1,60),1,62) $+ $chr(92)
      did -r browser 2
      if ($len($did(15)) != 3) {  did -a browser 2 <> }
      var %m $did(15)
      var %x $finddir(%m,*,0,1,did -a browser 2 < $+ $nopath($1-) $+ >) | unset %x
      var %x $findfile(%m,*,0,1,did -a browser 2  $nopath($1-))
    }
    else {
      run " $+ $did(15) $+ $did(2).seltext $+ "
    }
  }
  else {
    var %x $deltok($did(15),$numtok($did(15),92),92) $+ \
    did -r browser 15,2
    did -a browser 15 %x 
    if ($len($did(15)) != 3) {  did -a browser 2 <> }
    unset %x
    var %x $finddir($did(15),*,0,1,did -a browser 2 < $+ $nopath($1-) $+ >) | unset %x
    var %x $findfile($did(15),*,0,1,did -a browser 2  $nopath($1-))
  }
}
on *:dialog:browser:sclick:16 {
  var %m $input(Enter Address,eq)
  if ($mid(%m,3,1) != \) { var %l $$input(Please write a valid directory eg: C:\windows,o,error) | unset %l }
  else { 

    if ($isdir(%m)) {
      did -r browser 2
      did -ra browser 15 %m $+ \
      if ($len(%m) != 3) { did -a browser 2 <> }
      var %x $finddir(%m,*,0,1,did -a browser 2 < $+ $nopath($1-) $+ >) | unset %x
      var %x $findfile(%m,*,0,1,did -a browser 2  $nopath($1-))
    }
    else { var %a  $$input(Please write a valid directory eg: C:\windows,o,error) | unset %a }
  }
}
on *:dialog:browser:Sclick:5 {
  unset %cutter
  if ($did(2).sel) && ($isfile(" $+ $did(15) $+ $did(2).seltext $+ "))  {
    set %copied $did(15) $+ $did(2).seltext
  }
}
on *:dialog:browser:Sclick:6 {
  if  (%cutter) && (!$isfile(" $+ $did(browser,15)  $+ $gettok(%copied,-1,92) $+ ")) { var %h 1 }
  echo Copying in progress... 
  if ($isfile(" $+ $did(15)  $+ $gettok(%copied,-1,92) $+ ")) { echo OverWriting 3 $+ " $+ $did(15)  $+ $gettok(%copied,-1,92) $+ " $+ ... }
  .copy -o  " $+ %copied $+ " " $+ $did(15) $+ "
  if (%h) { .remove " $+ %copied $+ " }
  browser.refresh
}
on *:dialog:browser:sclick:7 {
  set %cutter 1
  if ($did(2).sel) {
    set %copied $did(15) $+ $did(2).seltext
  }
}
on *:dialog:browser:sclick:9 {
  if ($isfile(" $+ $did(15) $+ $did(2).seltext $+ ")) {
    var %i $input(are you sure you want to delete $did(15) $+ $did(2).seltext,y,confirmation)
    if (%i) { .remove " $+ $did(15) $+ $did(2).seltext $+ " | unset %i |  browser.refresh }

  }
  else {
    if ($isdir(" $+ $did(15) $+ $gettok($gettok($did(2).seltext,1,62),1,60) %+ ")) {
      var %i $$input(are you sure you want to delete $did(15) $+ $gettok($gettok($did(2).seltext,1,62),1,60) ,y,confirmation)
      if (%i) { .rmdir " $+ $did(15) $+ $gettok($gettok($did(2).seltext,1,62),1,60) $+ " | unset %i | browser.refresh }
    }
  }
}
on *:dialog:browser:sclick:12 {
  var %m $$input(enter location of file/folder,oeq,Run)
  .run %m

}
on *:dialog:browser:sclick:4 {
  if ($isfile(" $+ $did(15) $+ $did(2).seltext $+ ")) { .rename " $+ $did(15) $+ $did(2).seltext $+ " " $+ $did(15) $+ $$input(type new name,eq,rename,$did(2).seltext) $+ " | browser.refresh  }
}
on *:dialog:browser:sclick:10 {
  if ($isdir(" $+ $did(15) $+ $gettok($gettok($did(2).seltext,1,62),1,60) $+ ")) { 
    set %folder.name $gettok($gettok($did(2).seltext,1,62),1,60)
    set %folder.files $findfile(" $+ $did(15) $+ $gettok($gettok($did(2).seltext,1,62) $+ ",1,60),*,0)
    set %folder.location $did(15) $+ $gettok($gettok($did(2).seltext,1,62),1,60)
    var %m 0
    var %x $findfile(" $+ $did(15) $+ $gettok($gettok($did(2).seltext,1,62) $+ ",1,60),*,0,inc %m $file($1-).size)
    set %folder.size $mid($calc(%m /1000000),1,4) $+ MB
    dialog -m props props 
  }
  else if ($isfile(" $+ $did(15) $+ $did(2).seltext $+ ")) {
    set %file.name $did(2).seltext
    set %file.location $did(15) $+ $did(2).seltext
    set %file.size $mid($calc($file(" $+ $did(15) $+ $did(2).seltext $+ ").size / 1000000),1,4) $+ MB
    dialog -m props2 props2
  }
}

on *:dialog:props:init:* {
  did -a props  2 %folder.name
  did -a props 4 %folder.location
  did -a props 9 %folder.files $+ file(s)
  did -a props 7 %folder.size
  unset %folder.*
}
on *:dialog:props2:init:* {
  did -a props2 2 %file.name
  did -a props2 4 %file.location
  did -a props2 7 %file.size
  unset %file.*
}
on *:dialog:browser:sclick:2 {
  if ($gettok($did(2).seltext,$numtok($did(2).seltext,46),46) isin jpgbmp) {
    did -g browser 20 " $+ $did(15) $+ $did(2).seltext $+ "
    did -h browser 22
    did -v browser 20
  }

  elseif ($gettok($did(2).seltext,$numtok($did(2).seltext,46),46) isin txtinilog) {
    did -r browser 17
    loadbuf -o browser 17   " $+ $did(15) $+ $did(2).seltext $+ "
    did -h browser 20
    did -v browser 22
  }
  else { 
    did -r browser 17
    did -h browser 20
    did -v browser 22
  }
}
alias browser.refresh {
  did -r browser 2
  if ($len($did(15)) != 3) { did -a browser 2 <> }
  var %x $finddir($did(15),*,0,1,did -a browser 2 < $+ $nopath($1-) $+ >) | unset %x
  var %x $findfile($did(15),*,0,1,did -a browser 2  $nopath($1-))
}

Comments

Sign in to comment.
Urza   -  Feb 20, 2006

@ Yoinx - i THINK that only refers to events triggered remotely not locally.
I know they work in input events as well

 Respond  
RoninWarrior   -  Feb 19, 2006

so that means the multi mp3 players that are in the snippets pages are snippets then quickstep even though thay have muti functions i have to dis agree with you on that this and not all addons,snippets need to have a million functions to be a addon.

 Respond  
Gex   -  Feb 18, 2006

@xDaeMoN in most of the aliases/events i use %var and unset it in the end if the sub thats y i use the local variables because i dont wanna take much space for variables...i thought in making it in hash tables but u kno i get bored from hash :D. anyway

\"You are still not using the correct usage of /var.

Syntax: /var %var = data\"

i donno y should i use %var = data while %var data is working,however tell me what is the difference??.
@QuickStep as u said doesnt need to be addon cz it hasnt got any dlls/icons. and thanks for the $$input .

thanks all

 Respond  
Yoinx   -  Feb 18, 2006

ok, I gotta ask... from the help file for $input

Note: This identifier cannot be used in a script event. One way around this is to use a /timer to initiate an input request after the script ends.

do dialog script events not count as a \'script event\' ?

 Respond  
QuickStep   -  Feb 18, 2006

That check can easily be accomplished by using $$input instead of $input (double $$), script won\'t continue if $input is $null

 Respond  
Corne   -  Feb 18, 2006

You should do a check if a new name is entered (for the rename button). If I click on \'cancel\' I will get \'/rename: invalid parameters...\'

 Respond  
DarthReven   -  Feb 18, 2006

There\'s really nothing wrong with the way he was setting his local variables xDaeMoN though the way you point out is usually the better way to go about doing it. More imporantly he could set more then one local variable at a time in one line rather then setting them one by one.
EX: var %var $data, %var_2 $data_2, %var_3 $data_3

 Respond  
QuickStep   -  Feb 18, 2006

nice idea and well done. This is actually a snippet and not an addon; Usually a snippet becomes an addon when it contains multiple configuration, script or picture files that cannot be included with a snippet.

 Respond  
RoninWarrior   -  Feb 18, 2006

This should be a addon.

 Respond  
xDaeMoN   -  Feb 18, 2006

You are still not using the correct usage of /var.

Syntax: /var %var = data

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.