Skip to content

Commit 74a75a7

Browse files
committed
v1.106 icon path fixes for compiled script
1 parent 4fd2a1a commit 74a75a7

File tree

4 files changed

+57
-26
lines changed

4 files changed

+57
-26
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
### v1.106
4+
5+
* Fix: correct path for compiled script (to executable) for tray menu icons
6+
* Adding Try to all Menu, Icon to avoid errors in case they are missing
7+
38
### v1.105
49

510
* Fix: adding missing ico to FileInstall for compiled scripts

cl3.ahk

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
33
Script : CL3 ( = CLCL CLone ) - AutoHotkey 1.1+ (Ansi and Unicode)
4-
Version : 1.105
4+
Version : 1.106
55
Author : hi5
66
Purpose : A lightweight clone of the CLCL clipboard caching utility which can be found at
77
http://www.nakka.com/soft/clcl/index_eng.html written in AutoHotkey
@@ -40,7 +40,7 @@ SetWorkingDir, %A_ScriptDir%
4040
AutoTrim, off
4141
StringCaseSense, On
4242
name:="CL3 "
43-
version:="v1.105"
43+
version:="v1.106"
4444
CycleFormat:=0
4545
Templates:={}
4646
Global CyclePlugins,History,SettingsObj,Slots,ClipChainData ; CyclePlugins v1.72+, others v1.9.4 for API access
@@ -58,7 +58,7 @@ loop, parse, iconlist, CSV
5858
icon%A_LoopField%:="icon-" A_LoopField ".ico"
5959

6060
; <for compiled scripts>
61-
;@Ahk2Exe-SetFileVersion 1.105
61+
;@Ahk2Exe-SetFileVersion 1.106
6262
;@Ahk2Exe-SetDescription CL3
6363
;@Ahk2Exe-SetCopyright MIT License - (c) https://github.com/hi5
6464
; </for compiled scripts>
@@ -85,45 +85,58 @@ Settings()
8585
Settings_Hotkeys()
8686
HistoryRules()
8787

88+
ahk_icons_path:=A_AhkPath
89+
If A_IsCompiled
90+
ahk_icons_path:=A_ScriptFullPath
91+
8892
; tray menu
89-
Menu, Tray, Icon, res\cl3.ico, , 1
93+
Try
94+
Menu, Tray, Icon, res\cl3.ico, , 1
9095
Menu, tray, Tip , %name% %version%
9196
Menu, tray, NoStandard
9297
Menu, tray, Add, %name% %version% , DoubleTrayClick
93-
Menu, tray, Icon, %name% %version% , res\cl3.ico
98+
Try
99+
Menu, tray, Icon, %name% %version% , res\cl3.ico
94100
Menu, tray, Default, %name% %version%
95101
Menu, tray, Click, 1 ; this will show the tray menu because we send {rbutton} at the DoubleTrayClick label
96102
Menu, tray, Add,
97103
Menu, tray, Add, &AutoReplace Active , TrayMenuHandler
98104
Menu, tray, Add, &FIFO Active , TrayMenuHandler
99105
Menu, tray, Add,
100106
Menu, tray, Add, &Usage statistics , TrayMenuHandler
101-
Menu, tray, Icon,&Usage statistics , shell32.dll, 278
107+
Try
108+
Menu, tray, Icon,&Usage statistics , shell32.dll, 278
102109
Menu, tray, Add,
103110
Menu, tray, Add, &Settings , TrayMenuHandler
104-
Menu, tray, Icon,&Settings , dsuiext.dll, 36
111+
Try
112+
Menu, tray, Icon,&Settings , dsuiext.dll, 36
105113
If A_IsCompiled
106114
{
107115
Menu, tray, Add, &Check for updates, TrayMenuHandler
108116
}
109117
Menu, tray, Add,
110118
Menu, tray, Add, &Reload CL3 , TrayMenuHandler
111-
Menu, tray, Icon,&Reload CL3 , shell32.dll, 239
119+
Try
120+
Menu, tray, Icon,&Reload CL3 , shell32.dll, 239
112121
If !A_IsCompiled
113122
{
114123
Menu, tray, Add, &Edit this script , TrayMenuHandler
115-
Menu, tray, Icon,&Edit this script , comres.dll, 7
124+
Try
125+
Menu, tray, Icon,&Edit this script , comres.dll, 7
116126
}
117127
Menu, tray, Add,
118128
Menu, tray, Add, &Suspend Hotkeys , TrayMenuHandler
119-
Menu, tray, Icon,&Suspend Hotkeys , %A_AhkPath%, 3
129+
Try
130+
Menu, tray, Icon,&Suspend Hotkeys , %ahk_icons_path%, 3
120131
Menu, tray, Add, &Pause Script , TrayMenuHandler
121-
Menu, tray, Icon,&Pause Script , %A_AhkPath%, 4
132+
Try
133+
Menu, tray, Icon,&Pause Script , %ahk_icons_path%, 4
122134
Menu, tray, Add,
123135
Menu, tray, Add, &Pause clipboard history, TrayMenuHandler
124136
Menu, tray, Add,
125137
Menu, tray, Add, Exit , SaveSettings
126-
Menu, tray, Icon, %MenuPadding%Exit , shell32.dll, 132
138+
Try
139+
Menu, tray, Icon, %MenuPadding%Exit , shell32.dll, 132
127140

128141
Menu, ClipMenu, Add, TempText, MenuHandler
129142
Menu, SubMenu1, Add, TempText, MenuHandler
@@ -478,23 +491,27 @@ If !FIFOACTIVE
478491
MenuTextClean:=Trim(MenuText,"#")
479492
MenuText:=key RegExReplace(MenuText, "m)([A-Z]+)" , " $1")
480493
Menu, Submenu1, Add, %MenuText%, SpecialMenuHandler
481-
Menu, Submenu1, Icon, %MenuText%, res\%iconS%,,16
494+
Try
495+
Menu, Submenu1, Icon, %MenuText%, res\%iconS%,,16
482496
If IsObject(%MenuTextClean%Menu)
483497
{
484498
Menu, Submenu1, Add, %MenuText%, :%MenuTextClean%Menu
485-
Menu, Submenu1, Icon, %MenuText%, res\%iconS%,,16
499+
Try
500+
Menu, Submenu1, Icon, %MenuText%, res\%iconS%,,16
486501
}
487502
If IsObject(SlotsNamed) and (MenuTextClean ="Slots")
488503
{
489504
Gosub, QuickSlotsMenu
490505
Menu, Submenu1, Add, %MenuText%, :QuickSlotsMenu
491-
Menu, Submenu1, Icon, %MenuText%, res\%iconS%,,16
506+
Try
507+
Menu, Submenu1, Icon, %MenuText%, res\%iconS%,,16
492508
}
493509
}
494510
If ShowSpecial
495511
{
496512
Menu, ClipMenu, Add, &s. Special, :Submenu1
497-
Menu, ClipMenu, Icon, &s. Special, res\%iconS%,,16
513+
Try
514+
Menu, ClipMenu, Icon, &s. Special, res\%iconS%,,16
498515
}
499516

500517
If ShowTemplates
@@ -514,7 +531,8 @@ If ShowTemplates
514531
Menu, Submenu2, Icon, %MenuText%, res\%iconT%,,16
515532
}
516533
Menu, Submenu2, Add, &0. Open templates folder, TemplateMenuHandler
517-
Menu, Submenu2, Icon, &0. Open templates folder, res\%iconT%,,16
534+
Try
535+
Menu, Submenu2, Icon, &0. Open templates folder, res\%iconT%,,16
518536

519537
If (templatesfolderlist <> "")
520538
{
@@ -537,7 +555,8 @@ If ShowTemplates
537555
key:=% "&" Chr(96+(++MenuAccelerator)) ". " ; %
538556
MenuText:=key SubStr(A_LoopField, InStr(A_LoopField,"_")+1)
539557
Menu, %subtemplatefolder%, Add, %MenuText%, TemplateMenuHandler
540-
Menu, %subtemplatefolder%, Icon, %MenuText%, res\%iconT%,,16
558+
Try
559+
Menu, %subtemplatefolder%, Icon, %MenuText%, res\%iconT%,,16
541560
a:=""
542561
}
543562
templatefolderFiles:=""
@@ -556,7 +575,8 @@ If ShowTemplates
556575
Else
557576
Menu, Submenu2, Add, "No templates", TemplateMenuHandler
558577
Menu, ClipMenu, Add, &t. Templates, :Submenu2
559-
Menu, ClipMenu, Icon, &t. Templates, res\%iconT%,,16
578+
Try
579+
Menu, ClipMenu, Icon, &t. Templates, res\%iconT%,,16
560580
}
561581
Loop 18
562582
Menu, Submenu3, Add, % "&" Chr(96+A_Index) ".", MenuHandler
@@ -601,24 +621,28 @@ If (History.MaxIndex() > 20)
601621
Else
602622
{
603623
Menu, SubMenu4, Add, No entries ..., MenuHandler
604-
Menu, SubMenu4, Icon, No entries ..., res\%iconA%, , 16
624+
Try
625+
Menu, SubMenu4, Icon, No entries ..., res\%iconA%, , 16
605626
}
606627

607628
If !FIFOACTIVE and ShowYank
608629
{
609630
Menu, ClipMenu, Add, &y. Yank entry, :Submenu3
610-
Menu, ClipMenu, Icon, &y. Yank entry, res\%iconY%,,16
631+
Try
632+
Menu, ClipMenu, Icon, &y. Yank entry, res\%iconY%,,16
611633
}
612634
If ShowMorehistory
613635
{
614636
Menu, ClipMenu, Add, &z. More history, :Submenu4
615-
Menu, ClipMenu, Icon, &z. More history, res\%iconZ%,,16
637+
Try
638+
Menu, ClipMenu, Icon, &z. More history, res\%iconZ%,,16
616639
}
617640
If ShowExit
618641
{
619642
Menu, ClipMenu, Add
620643
Menu, ClipMenu, Add, E&xit (Close menu), MenuHandler
621-
Menu, ClipMenu, Icon, E&xit (Close menu), res\%iconX%,,16
644+
Try
645+
Menu, ClipMenu, Icon, E&xit (Close menu), res\%iconX%,,16
622646
}
623647
Return
624648

lib/cl3apiclass.ahk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ class CL3API
2929
{
3030
OnClipboardChange("FuncOnClipboardChange", 1)
3131
Menu, tray, ToggleCheck, &Pause clipboard history
32-
Menu, Tray, Icon, res\cl3.ico
32+
Try
33+
Menu, Tray, Icon, res\cl3.ico
3334
}
3435
else if toggle in off,false,0
3536
{
3637
OnClipboardChange("FuncOnClipboardChange", 0)
3738
Menu, tray, ToggleCheck, &Pause clipboard history
38-
Menu, Tray, Icon, res\cl3_clipboard_history_paused.ico
39+
Try
40+
Menu, Tray, Icon, res\cl3_clipboard_history_paused.ico
3941
}
4042
}
4143

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CL3 <sup>v1.105</sup> - Clipboard caching utility
1+
# CL3 <sup>v1.106</sup> - Clipboard caching utility
22

33
CL3 started as a lightweight clone of the CLCL clipboard caching utility
44
which can be found at <http://www.nakka.com/soft/clcl/index_eng.html>.

0 commit comments

Comments
 (0)