From 40062683af2b3e43b181cf92f955941690d253ea Mon Sep 17 00:00:00 2001 From: Thierry Dalon Date: Fri, 29 Sep 2023 10:37:09 +0200 Subject: [PATCH] Add Atlasy --- Atlasy.ahk | 110 +++++ Lib/Clip.ahk | 100 ++-- Lib/Confluence.ahk | 508 ++++++++++++++------ Lib/Jira.ahk | 184 ++++++- Lib/R4J.ahk | 36 +- PowerToolsBundler.ahk | 2 +- atlasy.ico | Bin 0 -> 14540 bytes docs/_pages/Atlasy-Changelog.md | 13 + docs/_pages/Atlasy.md | 96 ++++ docs/_pages/PowerTools-Bundler-Changelog.md | 2 + docs/_pages/PowerTools-Changelogs.md | 5 +- docs/_pages/PowerTools.md | 5 +- 12 files changed, 827 insertions(+), 234 deletions(-) create mode 100644 Atlasy.ahk create mode 100644 atlasy.ico create mode 100644 docs/_pages/Atlasy-Changelog.md create mode 100644 docs/_pages/Atlasy.md diff --git a/Atlasy.ahk b/Atlasy.ahk new file mode 100644 index 0000000..2b12a74 --- /dev/null +++ b/Atlasy.ahk @@ -0,0 +1,110 @@ +; Homepage: https://tdalon.github.io/ahk/Teamsy +LastCompiled = 20230811075038 +#Include +#Include + +#SingleInstance force ; for running from editor + + +If (A_Args.Length() > 0) { + ; Loop, because of Launchy Runner Plugin not handling "..." properly as one input argument but splitting arguments at space + Loop % A_Args.Length() { + Arg := Arg . " " . A_Args[A_Index] + } + Atlasy(Trim(Arg)) + return +} + +; If (A_Args.Length() = 0) +SubMenuSettings := PowerTools_MenuTray() +Menu, SubMenuSettings, Add, Notification at Startup, MenuCb_ToggleSettingNotificationAtStartup + +RegRead, SettingNotificationAtStartup, HKEY_CURRENT_USER\Software\PowerTools, NotificationAtStartup +If (SettingNotificationAtStartup = "") + SettingNotificationAtStartup := True ; Default value +If (SettingNotificationAtStartup) { + Menu, SubMenuSettings, Check, Notification at Startup +} Else { + Menu, SubMenuSettings, UnCheck, Notification at Startup +} + +; Tooltip +If !a_iscompiled + FileGetTime, LastMod , %A_ScriptFullPath% +Else + LastMod := LastCompiled +FormatTime LastMod, %LastMod% D1 R + +sTooltip = %A_ScriptName% %LastMod%`nRight-Click on icon to access help/support. +Menu, Tray, Tip, %sTooltip% + + + +HotkeyIDList = Launcher + +; Hotkeys: Activate, Meeting Action Menus and Settings Menus +Loop, Parse, HotkeyIDList, `, +{ + HKid := A_LoopField + HKid := StrReplace(HKid," ","") + + RegRead, HK, HKEY_CURRENT_USER\Software\PowerTools, AtlasyHotkey%HKid% + ; Activate Hotkey + If (HK != "") { + Atlasy_HotkeyActivate(HKid,HK, False) + MenuLabel = %A_LoopField% `t(%HK%) + } Else + MenuLabel = %A_LoopField% + + Menu, SubMenuHotkeys, Add, %MenuLabel%, Atlasy_HotkeySet +} +Menu, SubMenuSettings, Add, Hotkeys, :SubMenuHotkeys +Menu, SubMenuMeeting, Add ; Separator + + +Menu,Tray,NoStandard +Menu, Tray, Add, Launcher, Atlasy_Launcher +Menu, Tray, Add +Menu, Tray,Standard + +return + + +; ###################################################################### +NotifyTrayClick_208: ; Middle click (Button up) +Atlasy_Launcher() +Return + +NotifyTrayClick_202: ; Left click (Button up) +Menu_Show(MenuGetHandle("Tray"), False, Menu_TrayParams()*) +Return + +NotifyTrayClick_205: ; Right click (Button up) + +SendInput, !{Esc} ; for call from system tray - get active window + +Return + +MenuCb_ToggleSettingNotificationAtStartup: +If (SettingNotificationAtStartup := !SettingNotificationAtStartup) { + Menu, SubMenuSettings, Check, Notification at Startup +} +Else { + Menu, SubMenuSettings, UnCheck, Notification at Startup +} +PowerTools_RegWrite("NotificationAtStartup",SettingNotificationAtStartup) +return + +; ---------------------------- FUNCTIONS ------------------------------------------ +NotifyTrayClick(P*) { ; v0.41 by SKAN on D39E/D39N @ tiny.cc/notifytrayclick + Static Msg, Fun:="NotifyTrayClick", NM:=OnMessage(0x404,Func(Fun),-1), Chk,T:=-250,Clk:=1 + If ( (NM := Format(Fun . "_{:03X}", Msg := P[2])) && P.Count()<4 ) + Return ( T := Max(-5000, 0-(P[1] ? Abs(P[1]) : 250)) ) + Critical + If ( ( Msg<0x201 || Msg>0x209 ) || ( IsFunc(NM) || Islabel(NM) )=0 ) + Return + Chk := (Fun . "_" . (Msg<=0x203 ? "203" : Msg<=0x206 ? "206" : Msg<=0x209 ? "209" : "")) + SetTimer, %NM%, % (Msg==0x203 || Msg==0x206 || Msg==0x209) + ? (-1, Clk:=2) : ( Clk=2 ? ("Off", Clk:=1) : ( IsFunc(Chk) || IsLabel(Chk) ? T : -1) ) + Return True +} ; eofun \ No newline at end of file diff --git a/Lib/Clip.ahk b/Lib/Clip.ahk index 5a24487..a7fdb58 100644 --- a/Lib/Clip.ahk +++ b/Lib/Clip.ahk @@ -6,7 +6,7 @@ GroupAdd, PlainEditor, ahk_exe Notepad.exe GroupAdd, PlainEditor, ahk_exe notepad++.exe GroupAdd, PlainEditor, ahk_exe atom.exe ; ------------------------------------------------------------------------------------------------------------------- -Clip_Paste(sText) { +Clip_Paste(sText,restore := True) { ; Syntax: Clip_Paste(sText) WinClip.Paste(sText) } ; eofun @@ -20,7 +20,7 @@ Clip_Wait() ; ------------------------------------------------------------------------------------------------------------------- Clip_Restore(ClipBackup) { Clip_Wait() ; in order not to overwrite running clipboard action like pasting -Clipboard:= ClipBackup +Clipboard := ClipBackup } ;eofun ; ------------------------------------------------------------------------------------------------------------------- Clip_Wait(){ @@ -80,6 +80,7 @@ If RegExMatch(sHtml,"^http") { } else { WinClip.SetText(sText) } + ;SetClipboardHTML(sHtml,HtmlHead,sText) ; does not work with WinClip.GetHtml ; WinClip.iSetHTML does not work (asked here https://www.autohotkey.com/boards/viewtopic.php?f=6&t=29314&p=393505#p393505) WinClip.SetHTML(sHtml) @@ -187,7 +188,6 @@ while(Clipboard){ } SendInput,^c Clip_Wait() - If (type = "text") { sSelection := clipboard } Else If (type ="html") { @@ -288,54 +288,52 @@ SetClipboardHTML(sHtml,,sText) ; ------------------------------------------------------------------------------------------------------------------- ; https://www.autohotkey.com/boards/viewtopic.php?f=6&t=80706&sid=af626493fb4d8358c95469ef05c17563 ; Drawback: winclip.gethtml does not work if SetClipboardHTML before & not from fresh run -> revert to WinClip.SetHTML -SetClipboardHTML(HtmlBody, HtmlHead:="", AltText:="") { ; v0.67 by SKAN on D393/D42B -Local F, Html, pMem, Bytes, hMemHTM:=0, hMemTXT:=0, Res1:=1, Res2:=1 ; @ tiny.cc/t80706 -Static CF_UNICODETEXT:=13, CFID:=DllCall("RegisterClipboardFormat", "Str","HTML Format") - - If ! DllCall("OpenClipboard", "Ptr",A_ScriptHwnd) - Return 0 - Else DllCall("EmptyClipboard") - - If (HtmlBody!="") - { - Html := "Version:0.9`r`nStartHTML:00000000`r`nEndHTML:00000000`r`nStartFragment" - . ":00000000`r`nEndFragment:00000000`r`n`r`n`r`n`r`n" - . HtmlHead . "`r`n`r`n`r`n`r`n" - . HtmlBody . "`r`n`r`n`r`n" - - Bytes := StrPut(Html, "utf-8") - hMemHTM := DllCall("GlobalAlloc", "Int",0x42, "Ptr",Bytes+4, "Ptr") - pMem := DllCall("GlobalLock", "Ptr",hMemHTM, "Ptr") - StrPut(Html, pMem, Bytes, "utf-8") - - F := DllCall("Shlwapi.dll\StrStrA", "Ptr",pMem, "AStr","", "Ptr") - pMem - StrPut(Format("{:08}", F), pMem+23, 8, "utf-8") - F := DllCall("Shlwapi.dll\StrStrA", "Ptr",pMem, "AStr","", "Ptr") - pMem - StrPut(Format("{:08}", F), pMem+41, 8, "utf-8") - F := DllCall("Shlwapi.dll\StrStrA", "Ptr",pMem, "AStr","" HtmlBody "" LF "" LF "" + + , Html := StrReplace(Html, "StartHTML:000000000", Format("StartHTML:{:09}", InStr(Html, "")) , Fix*) + , Html := StrReplace(Html, "EndHTML:000000000", Format("EndHTML:{:09}", InStr(Html, "")) , Fix*) + , Html := StrReplace(Html, "StartFragment:000000000", Format("StartFragment:{:09}", InStr(Html, "