;;; ClipDate by Gavin Quinn ;;; #Persistent FileInstall, ClipDate.ini, %A_ScriptDir%\ClipDate.ini, 0 FileInstall, ClipDate.ico, %A_ScriptDir%\ClipDate.ico, 0 FileInstall, clipdate.html, %A_ScriptDir%\clipdate.html, 0 FileInstall, clipdate.gif, %A_ScriptDir%\clipdate.gif, 0 FileInstall, blistering.gif, %A_ScriptDir%\blistering.gif, 0 FileInstall, blisteringsoft.css, %A_ScriptDir%\blisteringsoft.css, 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; variables ttVer = ClipDate v0.6 bLisTeRinG 2006 tmIni = ClipDate.ini tmSave = %Clipboard% ;;; read the Clipboard app and Window-titlebar text. iniRead, tmClp, %tmIni%, options, clipApplication iniRead, tmClpTxt, %tmIni%, options, clipAppWindowText ;;; read the debug status. iniRead, db, %tmIni%, options, debug ;;; read the Delay time. iniRead, tmTTY, %tmIni%, options, exitDelay ;;; read the Help-file path\name.exe. iniRead, tmHlp, %tmIni%, options, help ;;; 1 read the Keep app active status. iniRead, tmKeep, %tmIni%, options, keep If tmKeep = Error { tmKeep = no } ;;; 2 read the HotKey string and status. iniRead, tmKey, %tmIni%, options, repeatkey If tmKey = Error { tmKey = ^+v } iniRead, tmHot, %tmIni%, options, hotkey If tmHot = Error { tmHot = no } Hotkey, %tmKey%, tmGo If tmHot = no { Hotkey, %tmKey%, Off } ;;; 3 read the autoPaste status. iniRead, tmPst, %tmIni%, options, autopaste If tmPst = Error { tmPst = no } ;;; 4 read the User-Formats. Loop, 14 { iniRead, tmM, %tmIni%, menu, menu%a_index% iniRead, tmC, %tmIni%, menu, code%a_index% If tmM = Error { Break } Else { tmC%a_index% = %tmC% Menu, Tray, add, %tmM%, tmGo IfEqual, db, yes, MsgBox, iniFile:`t%tmIni%`nmenu:`t%tmM%`nvar:`ttmC%a_index%`ncode:`t%tmC%`ndebug:`t%db% } } Menu, Tray, add, Menu, Tray, add, Clip&Date, tmCD Menu, Tray, add, Clip&Time, tmCT Menu, Tray, add, Clip&Both, tmCB Menu, Tray, add, Menu, Tray, add, &KeepOpen, tmKeep Menu, Tray, add, auto&Paste, tmPaste Menu, Tray, add, &HotKey, tmHotKey IfExist, %tmClp%, Menu, Tray, add, &Clipboard, tmClip Menu, Tray, add, &Edit Settings, tmEdit Menu, Tray, add, &Help, tmHelp Menu, Tray, add, E&xit, tmExit Menu, Tray, icon, %A_ScriptDir%\ClipDate.ico Menu, Tray, tip, %Clipboard% Menu, Tray, default, Clip&Time Menu, Tray, nostandard ;;; Show checks on menu at start of run. If tmHot = yes { Menu, Tray, check, &HotKey } If tmKeep = yes { Menu, Tray, check, &KeepOpen } If tmPst = yes { Menu, Tray, check, auto&Paste } ;;; Do the menu display (or not). If tmHot = yes { If tmPaste = yes { Return } If tmKeep = no { tmKeep = yes Menu, Tray, check, &KeepOpen Return } } Menu, Tray, show Return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; presets tmCD: Clipboard = %a_dddd% %a_mmmm% %a_dd% %a_yyyy% Menu, Tray, default, Clip&Date Goto tmTT tmCT: FormatTime, tmT, , h:mm ss tt Clipboard = %tmT% Menu, Tray, default, Clip&Time Goto tmTT tmCB: FormatTime, tmT, , h:mm tt Clipboard = %tmT% %a_dddd% %a_mmmm% %a_dd% %a_yyyy% Menu, Tray, default, Clip&Both Goto tmTT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; routines tmClip: Run, %tmClp% Menu, Tray, show Return tmEdit: RunWait, %A_ScriptDir%\%tmIni% Reload Return tmExit: IfWinExist, %tmClpTxt% { WinClose, } Clipboard = %tmSave% ExitApp tmHelp: Run, %tmHlp% Return tmHotKey: If tmHot = yes { tmHot = no iniWrite, no, %tmIni%, options, hotkey Hotkey, %tmKey%, Off Menu, Tray, uncheck, &HotKey } Else { tmHot = yes tmKeep = yes iniWrite, yes, %tmIni%, options, hotkey ;Hotkey, %tmKey%, tmGo Hotkey, %tmKey%, On Menu, Tray, check, &HotKey Menu, Tray, check, &KeepOpen } Menu, Tray, show Return tmKeep: If tmKeep = yes { tmKeep = no iniWrite, no, %tmIni%, options, keep Menu, Tray, uncheck, &KeepOpen } Else { tmKeep = yes iniWrite, yes, %tmIni%, options, keep Menu, Tray, check, &KeepOpen } Menu, Tray, show Return tmPaste: If tmPst = yes { tmPst = no iniWrite, no, %tmIni%, options, autopaste Menu, Tray, uncheck, auto&Paste } Else { tmPst = yes iniWrite, yes, %tmIni%, options, autopaste Menu, Tray, check, auto&Paste } Menu, Tray, show Return tmTT: Tooltip, %Clipboard% Menu, Tray, Tip, %Clipboard% SetTimer, tmTTX, %tmTTY% Return If tmPst = yes { Return } If tmHot = no { IfEqual, tmKeep, yes, Menu, Tray, show } tmTTX: SetTimer, tmTTX, Off ToolTip, If tmPst = yes { Send,^v } If tmKeep = yes { Return } Goto tmExit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; get settings tmGo: ;;; Keep the last chosen MenuItem as double-click default. Menu, Tray, default, %A_ThisMenuItem% ;;; Get Menu# to choose Variable# (tm) & Clear Clipboard. Transform, tm, deref, `%tmC%a_ThisMenuItemPos%`% Clipboard = ;;; Split variable(tm) into Array (tmA1...tmAx) StringSplit, tmA, tm, %A_Space%, `%`, ;;; Get Line length ;;; Get Items from Line (raw:tmB fixed:tmD) Loop, 20 { tmB = `%tmA%a_index%`% Transform, tmD, deref, %tmB% IfEqual, tmD, , Break tmE = `%%tmD%`% tmF = Transform, tmF, deref, %tmE% ;ToolTip, D:`t%tmD%`nF:`t%tmF% ;Sleep, 2000 If tmF = { ;msgbox, Table If tmD = a_yy { StringRight, tmF, a_yyyy, 2 } If tmD = a_mmmm { tmF =%a_mmmm% } If tmD = a_mmm { tmF =%a_mmm% } If tmD = a_dddd { tmF =%a_dddd% } If tmD = a_ddd { tmF =%a_ddd% } If tmD = a_dd { tmF =%a_dd% } If tmD = a_h { FormatTime, tmF, , h } If tmD = a_hh { FormatTime, tmF, , hh } If tmD = a_HH { FormatTime, tmF, , HH } If tmD = a_min { FormatTime, tmF, , mm } If tmD = a_sec { FormatTime, tmF, , tt } If tmD = a_tt { FormatTime, tmF, , tt } If tmD = comma { tmF = `, } If tmD = hyphen { tmF =`- } If tmD = colon { tmF =`: } If tmD = space { AutoTrim, Off Clipboard = %Clipboard% %_space% AutoTrim, On } Else { Clipboard = %Clipboard%%tmF% } } Else { Clipboard = %Clipboard%%tmF% } IfEqual, db, yes, MsgBox, item:`t%a_index%`nB Raw:`t%tmB%`nD Code:`t%tmD%`nE Raw:`t%tmE%`nF String:`t%tmF%`nClip:`t%Clipboard% } tmA1= tmA2= tmA3= tmA4= tmA5= tmA6= tmA7= tmA8= tmA9= tmA10= tmA11= tmA12= tmA13= tmA14= tmA15= tmA16= tmA17= tmA18= tmA19= tmA20= tmB= tmD= tmE= tmF= tmG= Goto tmTT