Advertisement
kunkel321

AHK code for XYplorer with QAP

Dec 28th, 2022 (edited)
1,600
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;############## SAVE FAVE FOLDER XY > QAP ###############
  2. #IfWinActive, XYplorer
  3. !F1:: ; Trigger is Alt+F1
  4. ;MsgBox yes, you pressed the hotkey.
  5. ;--- Next two lines are options for script ----
  6. QAPpath := "C:\Program Files\Quick Access Popup" ; no slash/ at end of path
  7. ShowDialogs := 1 ; 1 shows QAP dialogs, 0 skips them.
  8. PlaceBefore := "z-bottom-of-folders"   ; In QAP > Add Folder > Menu Options > Add before this... list, go to this item.  Blank means don't use this feature.
  9. ;----------------------------------------------
  10.  
  11. selected := getSelected() ; calls function that is at the bottom
  12.  
  13. RegExMatch(selected, ".:\\.+\\", vPath)
  14.   if (!vPath)  ; This means the regex didn't find the pattern.
  15.     {
  16.         MsgBox no path found.  Stopping script.
  17.         Return
  18.     }
  19. if ShowDialogs = 1
  20.         Switch := "AddFile" ; If it's a folder, QAP will use Folder settings.
  21. else
  22.         Switch := "AddFileXpress" ; Skips dialogs and works tranparently.
  23.  
  24. if (!QAPpath) ; If no path is entered, use this default.
  25.     QAPpath := "C:\Program Files\Quick Access Popup"
  26. Run, "%QAPpath%\QAPmessenger.exe" %Switch% "%selected%"
  27.  
  28. If (ShowDialogs = 1) AND (PlaceBefore != "")
  29. {
  30.     WinWaitActive, Add Favorite
  31.     Control, TabRight,, SysTabControl321, ahk_class JeanLalonde.ca
  32.     sleep, 100
  33.     Control, ChooseString, %PlaceBefore%, ComboBox2, A
  34.     Send, !a
  35. }
  36. Return
  37.  
  38. ; function from Masonjar on ahk forum
  39. getSelected(){
  40.     cO:=clipboardAll
  41.     clipboard:=
  42.     send !c
  43.     clipWait
  44.     selected:=clipboard
  45.     clipboard:=cO
  46.     return selected
  47. }
  48. #IfWinActive
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement