Advertisement
kunkel321

Untitled

Dec 14th, 2022
1,008
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Autohotkey 1.57 KB | Software | 0 0
  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 := 0 ; 1 shows QAP dialogs, 0 skips them.
  8. PlaceBefore := ; 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. ifequal, ShowDialogs, 1 ;############ NOT WORKING ########################
  28. {
  29.     MsgBox, showDialogs = |%showDialogs%| `n`n PlaceBefore = |%placeBefore%|
  30.     IfNotEqual, PlaceBefore,
  31.     {
  32.         WinWaitActive, Add Favorite
  33.         Send, {Tab 8}
  34.         Send, {Right}
  35.         Send, {Tab 4}
  36.         Send, %PlaceBefore%
  37.         Send, !a
  38.     }
  39. }
  40. Return
  41. ; function from Masonjar on ahk forum
  42. getSelected(){
  43.     cO:=clipboardAll
  44.     clipboard:=
  45.     send !c
  46.     clipWait
  47.     selected:=clipboard
  48.     clipboard:=cO
  49.     return selected
  50. }
  51. #IfWinActive
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement