/* [CONFIG] setautostart=ON setwebbrowser=%A_ProgramFiles%\Internet Explorer\iexplore.exe setscriptpath=.\AutoScriptWriter setinstandusedscript=SendMode, Input`n#NoTrayIcon setsuggesttimes=12 setkwlaunchcolor =0xFFFF00 setguifontcolor = 0x000000 setcommandsuggestfrom=2 setcommandsuggestamount=5 [SCRIPT] */ IniRead, webbrowserfile, %A_ScriptName%, CONFIG, setwebbrowser, %A_ProgramFiles%\Internet Explorer\iexplore.exe IniRead, auto_start, %A_ScriptName%, CONFIG, setautostart, ASK IniRead, script_path, %A_ScriptName%, CONFIG, setscriptpath, %script_path% IniRead, suggest_times, %A_ScriptName%, CONFIG, setsuggesttimes, 12 IniRead, kwlaunch_color, %A_ScriptName%, CONFIG, setkwlaunchcolor, 0xFFAA00 IfEqual, kwlaunch_color, , SetEnv, kwlaunch_color, 0xFFAA00 IniRead, command_suggest_amount, %A_ScriptName%, CONFIG, setcommandsuggestamount, 3 IniRead, command_suggest_from, %A_ScriptName%, CONFIG, setcommandsuggestfrom, 3 IniRead, command_suggest_always, %A_ScriptName%, CONFIG, setcommandsuggestalways, OFF If (command_suggest_always != "ON" and command_suggest_always != "OFF") command_suggest_always = OFF ToolTip, STARTING UP...,0,50, 20 SendMessage, 0x400+19, kwlaunch_color,"0x0",, AHK_class tooltips_class32 #SingleInstance force SendMode Input CoordMode, ToolTip, Screen ;ToolTips are used to inform user and needs to be Screen relative CoordMode, Mouse, Screen DetectHiddenWindows, On #MaxThreadsPerHotkey 1 #NoEnv ;Environment variables will not be checked #InstallKeybdHook #UseHook On mwt_MaxWindows = 50 ;Maximal windows to hide (WINDOWHIDER) mwt_MaxLength = 260 ; Reduce this to restrict the width of the menu. ;standard text of KEYWORD LAUNCHER - CAPSLOCK+TAB bkp_starting_tooltip = - ESC = CANCEL`n- ALT+M = OPTIONS starting_tooltip := bkp_starting_tooltip GoSub, Create_command_suggest ;Creates the variable for executing scripts (Run, %ScriptName_A% ... StringTrimRight, ScriptName_A, A_ScriptName, 4 ScriptName_A .= ".exe" ;These separators are used for Files List Transform, txt_in_separator, Chr, 2 Transform, txt_out_separator, Chr, 3 ; HOTKEYs FOR CAPS-/NUM-/SCROLLLOCK*/Hotkey** ;Supported Hotkeys for CAPSLOCK, SCROLLLOCK and NUMLOCK any_lock_keys = a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z.0.1.2.3.4.5.6.7.8.9 ;Supported HOTKEYS for HOTKEY** speed_hot_keys = 01.02.03.04.05.06.07.08.09.0a.0b.0c.0d.0e.0f.0g.0h.0i.0j.0k.0l.0m.0n.0o.0p.0q.0r.0s.0t.0u.0v.0w.0x.0y.0z.10.12.13.14.15.16.17.18.19.1a.1b.1c.1d.1e.1f.1g.1h.1i.1j.1k.1l.1m.1n.1o.1p.1q.1r.1s.1t.1u.1v.1w.1x.1y.1z.20.21.23.24.25.26.27.28.29.2a.2b.2c.2d.2e.2f.2g.2h.2i.2j.2k.2l.2m.2n.2o.2p.2q.2r.2s.2t.2u.2v.2w.2x.2y.2z.30.31.32.34.35.36.37.38.39.3a.3b.3c.3d.3e.3f.3g.3h.3i.3j.3k.3l.3m.3n.3o.3p.3q.3r.3s.3t.3u.3v.3w.3x.3y.3z.40.41.42.43.45.46.47.48.49.4a.4b.4c.4d.4e.4f.4g.4h.4i.4j.4k.4l.4m.4n.4o.4p.4q.4r.4s.4t.4u.4v.4w.4x.4y.4z.50.51.52.53.54.56.57.58.59.5a.5b.5c.5d.5e.5f.5g.5h.5i.5j.5k.5l.5m.5n.5o.5p.5q.5r.5s.5t.5u.5v.5w.5x.5y.5z.60.61.62.63.64.65.67.68.69.6a.6b.6c.6d.6e.6f.6g.6h.6i.6j.6k.6l.6m.6n.6o.6p.6q.6r.6s.6t.6u.6v.6w.6x.6y.6z.70.71.72.73.74.75.76.78.79.7a.7b.7c.7d.7e.7f.7g.7h.7i.7j.7k.7l.7m.7n.7o.7p.7q.7r.7s.7t.7u.7v.7w.7x.7y.7z.80.81.82.83.84.85.86.87.89.8a.8b.8c.8d.8e.8f.8g.8h.8i.8j.8k.8l.8m.8n.8o.8p.8q.8r.8s.8t.8u.8v.8w.8x.8y.8z.90.91.92.93.94.95.96.97.98.9a.9b.9c.9d.9e.9f.9g.9h.9i.9j.9k.9l.9m.9n.9o.9p.9q.9r.9s.9t.9u.9v.9w.9x.9y.9z.a0.a1.a2.a3.a4.a5.a6.a7.a8.a9.ab.ac.ad.ae.af.ag.ah.ai.aj.ak.al.am.an.ao.ap.aq.ar.as.at.au.av.aw.ax.ay.az.b0.b1.b2.b3.b4.b5.b6.b7.b8.b9.ba.bc.bd.be.bf.bg.bh.bi.bj.bk.bl.bm.bn.bo.bp.bq.br.bs.bt.bu.bv.bw.bx.by.bz.c0.c1.c2.c3.c4.c5.c6.c7.c8.c9.ca.cb.cd.ce.cf.cg.ch.ci.cj.ck.cl.cm.cn.co.cp.cq.cr.cs.ct.cu.cv.cw.cx.cy.cz.d0.d1.d2.d3.d4.d5.d6.d7.d8.d9.da.db.dc.de.df.dg.dh.di.dj.dk.dl.dm.dn.do.dp.dq.dr.ds.dt.du.dv.dw.dx.dy.dz.e0.e1.e2.e3.e4.e5.e6.e7.e8.e9.ea.eb.ec.ed.ef.eg.eh.ei.ej.ek.el.em.en.eo.ep.eq.er.es.et.eu.ev.ew.ex.ey.ez.f0.f1.f2.f3.f4.f5.f6.f7.f8.f9.fa.fb.fc.fd.fe.fg.fh.fi.fj.fk.fl.fm.fn.fo.fp.fq.fr.fs.ft.fu.fv.fw.fx.fy.fz.g0.g1.g2.g3.g4.g5.g6.g7.g8.g9.ga.gb.gc.gd.ge.gf.gh.gi.gj.gk.gl.gm.gn.go.gp.gq.gr.gs.gt.gu.gv.gw.gx.gy.gz.h0.h1.h2.h3.h4.h5.h6.h7.h8.h9.ha.hb.hc.hd.he.hf.hg.hi.hj.hk.hl.hm.hn.ho.hp.hq.hr.hs.ht.hu.hv.hw.hx.hy.hz.i0.i1.i2.i3.i4.i5.i6.i7.i8.i9.ia.ib.ic.id.ie.if.ig.ih.ij.ik.il.im.in.io.ip.iq.ir.is.it.iu.iv.iw.ix.iy.iz.j0.j1.j2.j3.j4.j5.j6.j7.j8.j9.ja.jb.jc.jd.je.jf.jg.jh.ji.jk.jl.jm.jn.jo.jp.jq.jr.js.jt.ju.jv.jw.jx.jy.jz.k0.k1.k2.k3.k4.k5.k6.k7.k8.k9.ka.kb.kc.kd.ke.kf.kg.kh.ki.kj.kl.km.kn.ko.kp.kq.kr.ks.kt.ku.kv.kw.kx.ky.kz.l0.l1.l2.l3.l4.l5.l6.l7.l8.l9.la.lb.lc.ld.le.lf.lg.lh.li.lj.lk.lm.ln.lo.lp.lq.lr.ls.lt.lu.lv.lw.lx.ly.lz.m0.m1.m2.m3.m4.m5.m6.m7.m8.m9.ma.mb.mc.md.me.mf.mg.mh.mi.mj.mk.ml.mn.mo.mp.mq.mr.ms.mt.mu.mv.mw.mx.my.mz.n0.n1.n2.n3.n4.n5.n6.n7.n8.n9.na.nb.nc.nd.ne.nf.ng.nh.ni.nj.nk.nl.nm.no.np.nq.nr.ns.nt.nu.nv.nw.nx.ny.nz.o0.o1.o2.o3.o4.o5.o6.o7.o8.o9.oa.ob.oc.od.oe.of.og.oh.oi.oj.ok.ol.om.on.op.oq.or.os.ot.ou.ov.ow.ox.oy.oz.p0.p1.p2.p3.p4.p5.p6.p7.p8.p9.pa.pb.pc.pd.pe.pf.pg.ph.pi.pj.pk.pl.pm.pn.po.pq.pr.ps.pt.pu.pv.pw.px.py.pz.q0.q1.q2.q3.q4.q5.q6.q7.q8.q9.qa.qb.qc.qd.qe.qf.qg.qh.qi.qj.qk.ql.qm.qn.qo.qp.qr.qs.qt.qu.qv.qw.qx.qy.qz.r0.r1.r2.r3.r4.r5.r6.r7.r8.r9.ra.rb.rc.rd.re.rf.rg.rh.ri.rj.rk.rl.rm.rn.ro.rp.rq.rs.rt.ru.rv.rw.rx.ry.rz.s0.s1.s2.s3.s4.s5.s6.s7.s8.s9.sa.sb.sc.sd.se.sf.sg.sh.si.sj.sk.sl.sm.sn.so.sp.sq.sr.st.su.sv.sw.sx.sy.sz.t0.t1.t2.t3.t4.t5.t6.t7.t8.t9.ta.tb.tc.td.te.tf.tg.th.ti.tj.tk.tl.tm.tn.to.tp.tq.tr.ts.tu.tv.tw.tx.ty.tz.u0.u1.u2.u3.u4.u5.u6.u7.u8.u9.ua.ub.uc.ud.ue.uf.ug.uh.ui.uj.uk.ul.um.un.uo.up.uq.ur.us.ut.uv.uw.ux.uy.uz.v0.v1.v2.v3.v4.v5.v6.v7.v8.v9.va.vb.vc.vd.ve.vf.vg.vh.vi.vj.vk.vl.vm.vn.vo.vp.vq.vr.vs.vt.vu.vw.vx.vy.vz.w0.w1.w2.w3.w4.w5.w6.w7.w8.w9.wa.wb.wc.wd.we.wf.wg.wh.wi.wj.wk.wl.wm.wn.wo.wp.wq.wr.ws.wt.wu.wv.wx.wy.wz.x0.x1.x2.x3.x4.x5.x6.x7.x8.x9.xa.xb.xc.xd.xe.xf.xg.xh.xi.xj.xk.xl.xm.xn.xo.xp.xq.xr.xs.xt.xu.xv.xw.xy.xz.y0.y1.y2.y3.y4.y5.y6.y7.y8.y9.ya.yb.yc.yd.ye.yf.yg.yh.yi.yj.yk.yl.ym.yn.yo.yp.yq.yr.ys.yt.yu.yv.yw.yx.yz.z0.z1.z2.z3.z4.z5.z6.z7.z8.z9.za.zb.zc.zd.ze.zf.zg.zh.zi.zj.zk.zl.zm.zn.zo.zp.zq.zr.zs.zt.zu.zv.zw.zx.zy ;SUPPORTED NUMPAD HOTKEYS num_keys = 01.02.03.04.05.06.07.08.09.10.12.13.14.15.16.17.18.19.20.21.23.24.25.26.27.28.29.30.31.32.34.35.36.37.38.39.40.41.42.43.45.46.47.48.49.50.51.52.53.54.56.57.58.59.60.61.62.63.64.65.67.68.69.70.71.72.73.74.75.76.78.79.80.81.82.83.84.85.86.87.89.90.91.92.93.94.95.96.97.98 StringSplit, any_lock_keys, any_lock_keys, ., . ;Stores each possible hotkey CAPS/SCROLL/NUMLOCK in Array to create them later StringSplit, num_keys, num_keys, ., . ;Stores each possible hotkey for Numkeys only StringSplit, speed_hot_keys, speed_hot_keys, ., . ;Stores each possible hotkey for HOTKEY**(SPEEDHOTKEY) ;KEYS FOR RECORDING not implemented yet recordmodkeys = AppsKey|!|#|+|CapsLock|Scrolllock|NumLock|LControl|LAlt|LShift|Tab|Backspace|Enter|Left|Right|Up|Down|Delete|Insert|Escape|Home|End|PgUp|PgDn|Numpad0|Numpad1|Numpad2|Numpad3|Numpad4|Numpad5|Numpad6|Numpad7|Numpad8|Numpad9|NumpadDot|NumpadDiv|NumpadMult|NumpadAdd|NumpadSub|NumpadEnter|NumpadIns|NumpadEnd|NumpadDown|NumpadPgDn|NumpadLeft|NumpadClear|NumpadRight|NumpadHome|NumpadUp|NumpadPgUp|NumpadDel|NumpadDiv|NumpadMult|NumpadAdd|NumpadSub|NumpadEnter|F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12|F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24|Pause|Break|PrintScreen|LWin|RWin|RControl|RAlt|RShift|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|Space recordmodshort = {AppsKey}|{!}|{#}|{+}||||^|!|+|{TAB}|{BS}|{ENTER}|{LEFT}|{RIGHT}|{UP}|{DOWN}|{DEL}|{INS}|{ESC}|{HOME}|{END}|{PGUP}|{PGDN}|{Numpad0}|{Numpad1}|{Numpad2}|{Numpad3}|{Numpad4}|{Numpad5}|{Numpad6}|{Numpad7}|{Numpad8}|{Numpad9}|{NumpadDot}|{NumpadDiv}|{NumpadMult}|{NumpadAdd}|{NumpadSub}|{NumpadEnter}|{NumpadIns}|{NumpadEnd}|{NumpadDown}|{NumpadPgDn}|{NumpadLeft}|{NumpadClear}|{NumpadRight}|{NumpadHome}|{NumpadUp}|{NumpadPgUp}|{NumpadDel}|{NumpadDiv}|{NumpadMult}|{NumpadAdd}|{NumpadSub}|{NumpadEnter}|{F1}|{F2}|{F3}|{F4}|{F5}|{F6}|{F7}|{F8}|{F9}|{F10}|{F11}|{F12}|{F13}|{F14}|{F15}|{F16}|{F17}|{F18}|{F19}|{F20}|{F21}|{F22}|{F23}|{F24}|{PAUSE}|{BREAK}|{PRINTSCREEN}|#|#|^|!|+|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|0|1|2|3|4|5|6|7|8|9|{Space} StringSplit, recordmodkeys, recordmodkeys, | StringSplit, recordmodshort, recordmodshort, | OnExit, mwt_RestoreAllThenExit ;HOTKEYS PART#1 ;configure *LOCK & [a-z0-9] hotkeys for example CAPSLOCKa Loop %any_lock_keys0% { current_hot_key := any_lock_keys%A_Index% Hotkey, CAPSLOCK & %current_hot_key%, RunCapsLock Hotkey, SCROLLLOCK & %current_hot_key%, RunScrollLock Hotkey, NUMLOCK & %current_hot_key%, RunNumLock } ;This will run last entry from Keyword launcher or last executed script, also when it was run with a Hotkey Hotkey, CAPSLOCK & F2, Runvar Hotkey, CAPSLOCK & CTRL, Runvar ;Used to hide active window or unhide last hidden window Hotkey, CAPSLOCK & F3, mwt_UnMinimize Hotkey, CAPSLOCK & F4, mwt_Minimize ;This will enable HOTKEY**, if SPEEDHOTKEY = ON pressing P & F will start script if HOTKEYpf is in scripts name Hotkey, CTRL & CAPSLOCK, Speedhotkey Hotkey, CAPSLOCK & ENTER, Speedhotkey Hotkey, CAPSLOCK & ESC, Speedhotkey Hotkey, CAPSLOCK & BACKSPACE, Speedhotkey Hotkey, SCROLLLOCK & BACKSPACE, Speedhotkey Hotkey, NUMLOCK & BACKSPACE, Speedhotkey Hotkey, CAPSLOCK & SHIFT, FILEEXPLORER Hotkey, CAPSLOCK & TAB, KeyWord_Launcher ;Hotkey, ~LButton, RecordMouse, Off ;Hotkey, ~RButton, RecordMouse, Off Hotkey, NUMLOCK & NUMPAD1, RunNumLock Hotkey, NUMLOCK & NUMPAD2, RunNumLock Hotkey, NUMLOCK & NUMPAD3, RunNumLock Hotkey, NUMLOCK & NUMPAD4, RunNumLock Hotkey, NUMLOCK & NUMPAD5, RunNumLock Hotkey, NUMLOCK & NUMPAD6, RunNumLock Hotkey, NUMLOCK & NUMPAD7, RunNumLock Hotkey, NUMLOCK & NUMPAD8, RunNumLock Hotkey, NUMLOCK & NUMPAD9, RunNumLock Hotkey, NUMLOCK & NUMPAD0, RunNumLock Hotkey, NUMLOCK & NUMPADINS, RunNumLock Hotkey, NUMLOCK & NUMPADRIGHT, RunNumLock Hotkey, NUMLOCK & NUMPADEND, RunNumLock Hotkey, NUMLOCK & NUMPADDOWN, RunNumLock Hotkey, NUMLOCK & NUMPADPGDN, RunNumLock Hotkey, NUMLOCK & NUMPADLEFT, RunNumLock Hotkey, NUMLOCK & NUMPADCLEAR, RunNumLock Hotkey, NUMLOCK & NUMPADHOME, RunNumLock Hotkey, NUMLOCK & NUMPADUP, RunNumLock Hotkey, NUMLOCK & NUMPADPGUP, RunNumLock Hotkey, NUMLOCK & NUMPADDOT, RunNumLock Hotkey, NUMLOCK & NUMPADDEL, RunNumLock Hotkey, NUMLOCK & NUMPADDIV, RunNumLock Hotkey, NUMLOCK & NUMPADMULT, RunNumLock Hotkey, NUMLOCK & NUMPADADD, RunNumLock Hotkey, NUMLOCK & NUMPADSUB, RunNumLock Hotkey, NUMLOCK & NUMPADENTER, RunNumLock ;Numpad hotkeys Loop %num_keys0% { StringSplit, numkeyshotkey, num_keys%A_Index% Hotkey, NUMPAD%numkeyshotkey1% & NUMPAD%numkeyshotkey2%, RunHotkey, Off } ;Load Files List LOAD_FILES() GoSub, Create_Menu SetFormat, FLOAT, 0.16 ;needed for calculation OnExit, OnExit ToolTip, -------------`n%Scriptname_A%`n-------------`nTO START `t`t- CAPSLOCK + TAB`nFOR HELP `t`t- CAPSLOCK + F9`nSCRIPT MANAGER `t- CAPSLOCK + F5`nCANCEL `t`t- ESC,0,50, 20 SendMessage, 0x400+19, kwlaunch_color,"0x0",, AHK_class tooltips_class32 Sleep, 5000 ToolTip,,,,20 Return ;End of autoexecute Exit_App: ExitApp Return OnExit: WinGet, p_i_d_list, List, ahk_class AutoHotkey If p_i_d_list = 1 ExitApp else GoSub, Terminate_all ExitApp ;Hotkeys PART#2 List_Hotkeys: CAPSLOCK & F7:: KeyWait, CAPSLOCK SetCapsLockState, Off ListHotkeys Return CAPSLOCK & F10::Suspend CAPSLOCK & F11::Pause, Toggle, 1 Reload_Script: CAPSLOCK & F12:: KeyWait, CAPSLOCK SetCapsLockState, Off IfWinExist, ahk_id %hwnd% { MsgBox, 262148, RESTART, SCRIPTMANAGER IS STILL OPEN`nDO YOU WANT TO RESTART ANYWAY? IfMsgBox, No { WinShow, ahk_id %hwnd% WinActivate, ahk_id %hwnd% Return } } Reload Return ;HIDE STARTUP DISPLAY and Command Suggest ~ESCAPE:: { ToolTip,,,,20 ToolTip,,,,17 Return } ;Enter an environment variable in any explorer address bar and press CTRL & ENTER ~CTRL & ENTER::Send, {DEL}+5{HOME}+5{ENTER} #IfWinActive SCRIPT MANAGER AHK_class AutoHotkeyGUI ;Find Next ^F3:: FindNext(hedit) ;Find or Replace ^F:: CmnDlg_Replace( hwnd, "OnFind" ) ^R:: CmnDlg_Replace( hwnd, "OnFind" ) ;Goto Line ^G:: GoToLine() ;Open File ^O:: WinMenuSelectItem, ahk_id %hwnd%, , File, &Open File`tCTRL && O ;Save File ^S:: WinMenuSelectItem, ahk_id %hwnd%, , File, &Save File`tCTRL && S ;New File ^N:: WinMenuSelectItem, ahk_id %hwnd%, , File, &New File`tCTRL && N ;Close File without asking to save ^W:: WinMenuSelectItem, ahk_id %hwnd%, , File, &Close File`tCTRL && W ;File Save as ~CTRL & F12::WinMenuSelectItem, ahk_id %hwnd%, , File, Save File &As`tCTRL && F12 ;The Subroutine in Menu select checks if ListView has keyboard Focus and opens selected script if any selected ~ENTER:: WinMenuSelectItem, ahk_id %hwnd%, , File, Open Se&l. Script`tENTER ;here when you change between hiEdit and ListView it also stops displaying Command Suggest ~CTRL & TAB:: GoSub, RemoveToolTip WinMenuSelectItem, ahk_id %hwnd%, , Edit, &Select Script Return ;Select previous or next Tab ~CTRL & PgUp:: WinMenuSelectItem, ahk_id %hwnd%,,Edit, Pre&vious File`tCTRL && PgUp ~CTRL & PgDn:: WinMenuSelectItem, ahk_id %hwnd%,,Edit, Ne&xt File`tCTRL && PgDn ;requiered to stop displaying Command Suggest if any of following key is pressed ~Alt:: GoSub, RemoveToolTip ~LWin:: GoSub, RemoveToolTip ~RWin:: GoSub, RemoveToolTip ~LButton::GoSub, RemoveToolTip ~RButton::GoSub, RemoveToolTip ~MButton::GoSub, RemoveToolTip ;~BackSpace::SetEnv, HE_INFO_LAST, k ;uncomment if you like to display Command Suggest if Backspace is pressed #IfWinActive #IfWinActive Process Terminator AHK_Class AutoHotkeyGUI ~ENTER:: WinMenuSelectItem, Process Terminator AHK_Class AutoHotkeyGUI, , PROCESS, TERMINATE #IfWinActive ;This will also start keyword launcher ~LCONTROL:: { KeyWait, LControl, T0.2 If Errolevel = 1 return Sleep, 30 KeyWait, LShift, D T0.4 If Errorlevel = 1 return Sleep, 10 KeyWait, LShift, T0.2 If Errorlevel = 0 { Goto, KeyWord_Launcher } return } ;Speedhotkeys ON/OFF like A & B, D & 9, P & R... Speedhotkey: { KeyWait, CAPSLOCK SetCapsLockState, Off KeyWait, CONTROL KeyWait, ESCAPE If speedhotkeyon = EIN { ToolTip, TURNING SPEEDKEYS OFF..., , , 19 SendMessage, 0x400+19, kwlaunch_color,"0x0",, AHK_class tooltips_class32 Loop %num_keys0% { StringSplit, numkeyshotkey, num_keys%A_Index% Hotkey, NUMPAD%numkeyshotkey1% & NUMPAD%numkeyshotkey2%, Off } Loop %speed_hot_keys_list0% { StringLeft, hotkey_a, speed_hot_keys_list%A_Index%, 1 StringRight, hotkey_b, speed_hot_keys_list%A_Index%, 1 Hotkey, %hotkey_a% & %hotkey_b%, Off } speedhotkeyon = AUS Hotkey, CAPSLOCK & TAB, ON Hotkey, ~LCONTROL, ON Hotkey, CAPSLOCK & SHIFT, ON ToolTip, , , , 19 } else { ToolTip, TURNING SPEEDKEYS ON..., , , 19 SendMessage, 0x400+19, kwlaunch_color,"0x0",, AHK_class tooltips_class32 Loop %num_keys0% { StringSplit, numkeyshotkey, num_keys%A_Index% Hotkey, NUMPAD%numkeyshotkey1% & NUMPAD%numkeyshotkey2%, On } Loop %speed_hot_keys_list0% { StringLeft, hotkey_a, speed_hot_keys_list%A_Index%, 1 StringRight, hotkey_b, speed_hot_keys_list%A_Index%, 1 Hotkey, %hotkey_a% & %hotkey_b%, On } speedhotkeyon = EIN Hotkey, CAPSLOCK & TAB, OFF Hotkey, ~LCONTROL, OFF Hotkey, CAPSLOCK & SHIFT, OFF ToolTip, SPEEDHOTKEY ON, , , 19 } BlockInput, Off Return } ;Emptys Memory EmptyMem(PID="AHK Rocks"){ pid:=(pid="AHK Rocks") ? DllCall("GetCurrentProcessId") : pid h:=DllCall("OpenProcess", "UInt", 0x001F0FFF, "Int", 0, "Int", pid) DllCall("SetProcessWorkingSetSize", "UInt", h, "Int", -1, "Int", -1) DllCall("CloseHandle", "Int", h) } ;Loads all files and settings, this is also launched when a new script is added or deleted as well as when name of script changed LOAD_FILES(){ global speed_hot_keys_list = Loop %any_lock_keys0% { A_KeyIndex := any_lock_keys%A_Index% capslockvar%A_KeyIndex% = scrolllockvar%A_KeyIndex% = numlockvar%A_KeyIndex% = } Loop %speed_hot_keys0% { A_KeyIndex := speed_hot_keys%A_Index% hotkey_var%A_KeyIndex% = } script_count = script_count0 = script_all= Loop, %script_path%\*.* { ;MsgBox % A_LoopFileName ;MsgBox % A_LoopFileExt If RegExMatch(A_LoopFileName, "^\w+\.") = 1 { StringLeft, LoopFileName_A, A_LoopFileName, RegExMatch(A_LoopFileName, "\.")-1 If (LoopFileName_A = script_count%script_count0%) continue script_count0++ script_all .= txt_in_separator . A_LoopFileName . txt_out_separator script_count%script_count0% = %LoopFileName_A% script_count_size%script_count0% = %A_LoopFileSize% FormatTime, script_count_accessed%script_count0%, %A_LoopFileTimeAccessed%, dd.MM.yyyy HH:mm FormatTime, script_count_modified%script_count0%, %A_LoopFileTimeModified%, dd.MM.yyyy HH:mm FormatTime, script_count_created%script_count0%, %A_LoopFileTimeCreated%, dd.MM.yyyy HH:mm %LoopFileName_A% = %A_LoopFileName% } else { continue } If script_first_run = { If auto_start = ASK { If (RegExMatch(A_LoopFileName, "AUTOSTART", CaseSensitive=false) != 0) { MsgBox, 262148, AUTOSTART, , 3 IfMsgBox Yes { auto_start = On Run, %ScriptName_A% "%A_LoopFileName%", %script_path%\ } else { auto_start = Off } autostartvar = } } else if auto_start = On { If (RegExMatch(A_LoopFileName, "AUTOSTART", CaseSensitive=false) != 0) Run, %ScriptName_A% "%A_LoopFileName%", %script_path%\ } } If (RegExMatch(A_LoopFileName, "CAPSLOCK.", CaseSensitive=false) != 0) { StringMid, fav_number, A_LoopFileName, InStr(A_LoopFileName, "capslock", CaseSensitive = false)+8, 1 IfInString, any_lock_keys, %fav_number% capslock_var%fav_number% = %LoopFileName_A% } If (RegExMatch(A_LoopFileName, "SCROLLLOCK.", CaseSensitive=false) != 0) { StringMid, fav_number, A_LoopFileName, InStr(A_LoopFileName, "scrolllock", CaseSensitive = false)+10, 1 IfInString, any_lock_keys, %fav_number% scrolllock_var%fav_number% = %LoopFileName_A% } If (RegExMatch(A_LoopFileName, "NUMLOCK.", CaseSensitive=false) != 0) { StringMid, fav_number, A_LoopFileName, InStr(A_LoopFileName, "numlock", CaseSensitive = false)+7, 1 IfInString, any_lock_keys, %fav_number% numlockvar%favnumber% = %LoopFileName_A% } If (RegExMatch(A_LoopFileName, "HOTKEY..", CaseSensitive=false) != 0) { StringMid, fav_number, A_LoopFileName, InStr(A_LoopFileName, "hotkey", CaseSensitive = false)+6, 2 If (InStr(speed_hot_keys, fav_number . ".") and fav_number != "" and StrLen(fav_number) = 2) { hotkey_var%fav_number% = %LoopFileName_A% speed_hot_keys_list .= fav_number . "." StringLeft, hotkey_a, fav_number, 1 StringRight, hotkey_b, fav_number, 1 Hotkey, %hotkey_a% & %hotkey_b%, RunHotkey, Off } } LoopFileName_A = } StringSplit, speed_hot_keys_list, speed_hot_keys_list, . speed_hot_keys_list0 -= 1 auto_start = OFF script_first_run = NO EmptyMem() Return } ;Hotkeys subroutines will run after CAPSLOCK is released ;when you press several hotkeys holding CAPSLOCK, only the last one will run ;same is for SCROLLLOCK./NUMLOCK. and HOTKEY.. RunCapsLock: { ToolTip,,,,20 running_capslock++ StringRight, hotkey_var_to_run, A_ThisHotkey, 1 If capslock_var%hotkey_var_to_run% = { running_capslock-- Return } If running_capslock > 1 { running_capslock-- Return } KeyWait, %hotkey_var_to_run% KeyWait, CAPSLOCK Send, {%hotkey_var_to_run% UP} SetCapsLockState, Off out := capslock_var%hotkey_var_to_run% running_capslock = hotkey_var_to_run = RunVar() Return } RunScrollLock: { ToolTip,,,,20 running_scrolllock++ StringRight, hotkey_var_to_run, A_ThisHotkey, 1 If scrolllock_var%hotkey_var_to_run% = { running_scrolllock-- Return } If running_scrolllock > 1 { running_scrolllock-- Return } KeyWait, %hotkey_var_to_run% KeyWait, SCROLLLOCK Send, {%hotkey_var_to_run% UP} SetScrollLockState, Off out := scrolllock_var%hotkey_var_to_run% running_scrolllock = hotkey_var_to_run = RunVar() Return } RunNumLock: { ToolTip,,,,20 running_numlock++ StringRight, hotkey_var_to_run, A_ThisHotkey, 1 KeyWait, %hotkey_var_to_run2% KeyWait, NUMLOCK Send, {%hotkey_var_to_run2% UP} SetNumLockState, On IfInString, A_ThisHotkey, NUMPAD { StringSplit, hotkey_var_to_runreplace, A_ThisHotkey, &, %A_Space% If hotkey_var_to_runreplace2 = NUMPADINS hotkey_var_to_run = 0 If hotkey_var_to_runreplace2 = NUMPADEND hotkey_var_to_run = 1 If hotkey_var_to_runreplace2 = NUMPADDOWN hotkey_var_to_run = 2 If hotkey_var_to_runreplace2 = NUMPADPGDN hotkey_var_to_run = 3 If hotkey_var_to_runreplace2 = NUMPADLEFT hotkey_var_to_run = 4 If hotkey_var_to_runreplace2 = NUMPADCLEAR hotkey_var_to_run = 5 If hotkey_var_to_runreplace2 = NUMPADRIGHT hotkey_var_to_run = 6 If hotkey_var_to_runreplace2 = NUMPADHOME hotkey_var_to_run = 7 If hotkey_var_to_runreplace2 = NUMPADUP hotkey_var_to_run = 8 If hotkey_var_to_runreplace2 = NUMPADPGUP hotkey_var_to_run = 9 If hotkey_var_to_runreplace2 = NUMPADDEL hotkey_var_to_run = d If hotkey_var_to_runreplace2 = NUMPADDIV hotkey_var_to_run = v If hotkey_var_to_runreplace2 = NUMPADMULT hotkey_var_to_run = m If hotkey_var_to_runreplace2 = NUMPADADD hotkey_var_to_run = a If hotkey_var_to_runreplace2 = NUMPADSUB hotkey_var_to_run = s If hotkey_var_to_runreplace2 = NUMPADENTER hotkey_var_to_run = e ;MsgBox, %hotkey_var_to_run% } If numlock_var%hotkey_var_to_run% = { running_numlock-- Return } If running_numlock > 1 { running_numlock-- Return } out := numlock_var%hotkey_var_to_run% running_numlock = hotkey_var_to_run = RunVar() Return } RunHotkey: { ToolTip,,,,20 running_hot_key++ StringSplit, hot_key_to_run, A_ThisHotkey, &, %A_Space% StringRight, hotkey_var_to_run1, hot_key_to_run1, 1 StringRight, hotkey_var_to_run2, hot_key_to_run2, 1 hot_key_to_run = %hotkey_var_to_run1%%hotkey_var_to_run2% If hotkey_var%hot_key_to_run% = { running_hot_key-- Return } If running_hot_key > 1 { running_hot_key-- Return } KeyWait, %hot_key_to_run2% KeyWait, %hot_key_to_run1% Send, {%hot_key_to_run2% UP}{%hot_key_to_run1% UP} ;ToolTip % A_ThisHotkey, 0, 60, 4 out := hotkey_var%hot_key_to_run% running_hot_key = hot_key_to_run = RunVar() Return } 1Include_MainGui: Return ;KeyWord launcher KeyWord_Launcher: { KeyWait, CAPSLOCK SetCapsLockState, Off GoSub, RemoveToolTip ToolTip % starting_tooltip, , , 20 SendMessage, 0x400+19, kwlaunch_color,"0x0",, AHK_class tooltips_class32 Loop %suggest_times% found_script%A_Index% = AutoTrim, Off Loop { outfunc = If out = { ToolTip % starting_tooltip, , , 20 SendMessage, 0x400+19, kwlaunch_color,"0x0",, AHK_class tooltips_class32 } Input, output, L1, {ENTER}{LALT}{ESC}{BS}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F10}{F11}{F12}{TAB} If Errorlevel = Max { If outputspace = out =%out%%output% } else if Errorlevel = EndKey:Tab { saved += 1 out := savedout%saved% If savedout%saved% = saved = } else if Errorlevel = EndKey:Enter { saved = ToolTip,,,,20 If out = { Return } If (out != savedout1) { countsave = 30 countsave2 = 29 Loop 29 { savedout%countsave% := savedout%countsave2% countsave -= 1 countsave2 -= 1 } savedout1 = %out% } If out = { Return } RunVar() Return } else if Errorlevel = EndKey:Backspace { StringTrimRight, out, out, 1 } else if Errorlevel = EndKey:Escape { ToolTip, CANCEL...,,,20 SendMessage, 0x400+19, kwlaunch_color,"0x0",, AHK_class tooltips_class32 Sleep, 200 ToolTip,,,,20 starting_tooltip := bkp_starting_tooltip out = outputspace = saved = Return } else if InStr(Errorlevel, "EndKey:F") { script_found_index := SubStr(ErrorLevel, 9) out := SubStr(found_script%script_found_index%, 1, InStr(found_script%script_found_index%, A_Tab)-1) If out = continue ToolTip,,,,20 GoTo, RunVar } else if Errorlevel = EndKey:LAlt { Loop { Input, outfunc, L1 M, {F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F10}{F11}{F12} If Errorlevel = Timeout { GetKeyState, altispressed, LALT, P If (altispressed = "D" and outfunc = "") continue else break } else { break } } If (InStr(Errorlevel, "EndKey:F")) { script_found_index := SubStr(ErrorLevel, 9) out := SubStr(found_script%script_found_index%, 1, InStr(found_script%script_found_index%, A_Tab)-1) If out = continue ToolTip,,,,20 If (FileExist(script_path . "\" . %out%) != "" and %out% != "") { GoSub, Script_Manager HE_OpenFile(hEdit, script_path . "\" . %out%) break } } else if outfunc = continue else if outfunc = v { If outputspace = 1 { out .= A_Space . clipboard outputspace = } else { out .= clipboard } ToolTip, %out%,,,20 continue } else if outfunc = a { ExitApp } else if outfunc = m { If moreoptions = yes { starting_tooltip := bkp_starting_tooltip moreoptions = } else { starting_tooltip = TYPE TO START`n--------------------------------------------------`n - ESC = CANCEL`n - ENTER = - WEBSEITE(no www..com)`n`t - `? TRANSLATE`n`t - `. GOOGLE SEARCH`n`t - `- EBAY SEARCH`n`t - : AHK Commands separated trough ``n`n`t This will create temporary script`n`t - `=5+5 `= CALCULATE`n`n`t - For Example type .google`n - ALT+X = FOLDER and FILE SEARCH(CAPSLOCK+SHIFT)`n - ALT+E = EDIT SCRIPT(CAPSLOCK+F8)`n - ALT+A = EXIT %Scriptname_A%`n - ALT+H = HIDE WINDOW(CAPSLOCK+F4)`n - ALT+U = UNHIDE WINDOW(CAPSLOCK+F3)`n - ALT+Q = HELP(CAPSLOCK+F9)`n - ALT+S = SCRIPT MANAGER(CAPSLOCK+F5 überall)`n - ALT+V = PASTE`n - ALT+R or CAPSLOCK+F12 = RESTART`n - TAB = LAST ENTRY moreoptions = yes } } else if outfunc = x { Goto, FileExplorer } else if outfunc = s { Goto, Script_Manager } else if outfunc = e { If (RegExMatch(out, "^\w+$") !=0) { If (FileExist(script_path . "\" . %out%) != "" and %out% != "") { GoSub, Script_Manager HE_OpenFile(hEdit, script_path . "\" . %out%) break } } } else if outfunc = q { Goto, Help_box } else if outfunc = h { Gosub, mwt_Minimize } else if outfunc = u { Gosub, mwt_UnMinimize } else if outfunc = r { ToolTip,,,,20 Reload } continue } If RegExMatch(out, "i)^\w+$") { reg_ex_search := "(" . txt_in_separator . out . ".*" . txt_out_separator . ")" If RegExMatch(script_all, "i)" . reg_ex_search, found_script) { script_suggest = Loop %suggest_times% { If (SubStr(found_script, 2, StrLen(out)) = out) { found_script%A_Index% := SubStr(found_script, 2, InStr(found_script, txt_out_separator)-2) StringTrimLeft, found_script, found_script, StrLen(found_script%A_Index%)+2 StringReplace, found_script%A_Index%, found_script%A_Index%, ., %A_Tab% script_suggest .= "`nF" . A_Index . A_Space . found_script%A_Index% } else break } If (script_suggest = "" and %out% != "") ToolTip % RegExReplace(%out%, "\.","`t","",1),,,20 else if (script_suggest != "" and %out% != "") ToolTip % RegExReplace(%out%, "\.","`t","",1) "`n" script_suggest,,,20 else if (script_suggest != "" and %out% = "") ToolTip % out "`n" script_suggest,,,20 else ToolTip % out,,,20 } else ToolTip % out,,,20 } else { ToolTip % out,,,20 } } ToolTip,,,,20 starting_tooltip := bkp_starting_tooltip out = outputspace = saved = } ;This runs when a hotkey is pressed or any entry in keyword launcher is launched ;It determines what to do on base of entry content ;for example if . is added in front it searches on google for the entry beside . e.g. .weather ;if you add : in front it will write the enty to a file and launch with AutoHotkey.exe e.g. :MsgBox % A_script_Name ;trough this also your scripts are launched 1Include_RunVar: Return RunVar: Runvar() Return Runvar(){ global KeyWait, CAPSLOCK SetCapsLockState, Off If speedhotkeyon = EIN { Loop %num_keys0% { StringSplit, numkeys_hotkey, num_keys%A_Index% Hotkey, NUMPAD%numkeys_hotkey1% & NUMPAD%numkeys_hotkey2%, Off } Loop %speed_hot_keys_list0% { StringLeft, hotkey_a, speed_hot_keys_list%A_Index%, 1 StringRight, hotkey_b, speed_hot_keys_list%A_Index%, 1 Hotkey, %hotkey_a% & %hotkey_b%, Off } speedhotkeyon = AUS Hotkey, CAPSLOCK & TAB, ON Hotkey, ~LCONTROL, ON Hotkey, CAPSLOCK & SHIFT, ON ToolTip,,,,19 } If out = outrunvar = %outlast% else { outrunvar = %out% outlast = %out% } out = If outrunvar = Return If (RegExMatch(outrunvar, "^\w+$") != 0) script_to_run := %outrunvar% If script_to_run = { ;If (RegExMatch(outrunvar, "^\w+\s*,", ahk_command) != 0) ; StringTrimRight, ahk_command, ahk_command, 1 ;IfInString, ahk_commands, |%ahk_command%| If (SubStr(outrunvar, 1, 1) = ":") { StringTrimLeft, outrunvar, outrunvar, 1 StringReplace, outrunvar, outrunvar, ``n, `n, A StringReplace, outrunvar, outrunvar, ``t, `t, A FileAppend, %outrunvar%, ahk_temp_script.ahk RunWait, %ScriptName_A% ahk_temp_script.ahk, %A_ScriptDir% FileDelete, ahk_temp_script.ahk } else GoSub, Go } else { Run, %ScriptName_A% "%script_to_run%",%script_path% } script_to_run = ahk_command = tmp_script_file = p_i_d = Return } ;This is the editor section Script_manager: CAPSLOCK & F5:: { KeyWait, CAPSLOCK SetCapsLockState, Off ToolTip,,,,20 IfWinExist, ahk_id %hwnd% { Gui, 98:Show WinActivate, ahk_id %hwnd% Return } Gui, 98:Menu, SCRIPTMANAGER Gui, 98:+LastFound +Resize Gui, 98:Default Gui, 98:Add, ListView, w780 +ReadOnly Grid -Multi gOpen_Script vScript_list_view, KEY (TYPE TO SELECT)|NAME (TO OPEN DCLICK OR ENTER - CTRL+TAB SWITCH TO EDIT)|SIZE (BYTES)|FILE ACCESSED LAST|FILE LAST MODIFIED|FILE CREATED TIME GuiControl, Focus, Script_list_view Fill_ListView() ;Gui, 98:Add, Button, x+1 ys w80 gSave_Script, SAVE SCRIPT ;Gui, 98:Add, Button, x+1 ys w190, DELETE SCRIPT hwnd := WinExist() hEdit := HE_Add(hwnd,0,105,800,490, "HSCROLL VSCROLL TABBED TABBEDHRZSB HILIGHT FILECHANGEALERT") fStyle := "s8" , fFace := "Courier New" HE_SetFont( hEdit, fStyle "," fFace) SetColors(hEdit) HE_SetTabWidth(hEdit, 4) HE_LineNumbersBar(hEdit, "automaxsize", 40, 0), lineNumbers := true HE_AutoIndent(hedit, true), autoIndent := true HE_SetKeywordFile( A_ScriptDir "\Keywords.hes") HE_SetEvents(hEdit, "OnHiEdit", "Key SelChange") ;GoSub, Open_File Gui, 98:Show, w800 h600, SCRIPT MANAGER ;SetTimer, Update_script, 2000 return } 98GuiClose: { Gui, 98:+OwnDialogs SetTimer, Update_script, Off If (HE_GetFileCount(hEdit) = 1 and InStr(HE_GetCurrentFile(hEdit), "*") != 0) { Gui, 98:Destroy } else { looptimes := HE_GetFileCount( hEdit ) file_name_full := HE_GetFileName(hEdit) If (InStr(file_name_full, "*") != 0 and looptimes = 1) { Gui, 98:Destroy EmptyMem() Return } MsgBox, 3, SAVE ON EXIT, DO YOU WANT TO SAVE ALL OPEN FILES IfMsgBox, Cancel Return IfMsgBox, Yes { Loop %looptimes% { looptimes-- file_name_full := HE_GetFileName(hEdit, looptimes) HE_SaveFile(hEdit, file_name_full, looptimes) HE_CloseFile(hEdit, looptimes) } Gui, 98:Destroy } IfMsgBox, No Gui, 98:Destroy } EmptyMem() return } 98GuiSize: Anchor("HiEdit1", "wh") Anchor("SysListView321", "w") return Update_script: SetTimer, Update_script, Off WinMenuSelectItem, ahk_id %hwnd%,, File, R&eload List Settimer, Update_script, 2000 Return Reload_list: IfWinNotActive, ahk_id %hwnd% Return ControlGetFocus, out_put_var, ahk_id %hwnd% Loop %script_path% { StringLeft, LoopFileName_A, A_LoopFileName, InStr(A_LoopFileName, ".") If (RegExMatch(LoopFileName_A, "^\w+$") = 0) continue LoopFileName_A = } selected_row := LV_GetNext() LV_Delete() Fill_ListView() If (selected_row != 0 and out_put_var = "SysListView321") { LV_Modify(selected_row, "Focus") LV_Modify(selected_row, "Select") LV_Modify(selected_row, "VIS") } Return Open_Script: Gui, 98:+OwnDialogs If (A_GuiEvent = "DoubleClick") { If A_EventInfo = 0 Return LV_GetText(script_key, A_EventInfo) file_is_already_open := He_GetFileName(hEdit) IfNotInString, file_is_already_open, * GoSub, New_File script_key := script_path . "\" . %script_key% HE_OpenFile(hEdit, script_key) script_file= script_key= } Return Open_selected_file: Gui, 98:+OwnDialogs GuiControlGet, out_put_var, FocusV If (out_put_var != "Script_List_view") Return ControlGet, out_put_var, List, Selected, SysListView321 If (out_put_var = "") Return file_is_already_open := He_GetFileName(hEdit) RegExMatch(out_put_var, "\w+", out_put_var) out_put_var := script_path . "\" . %out_put_var% IfNotInString, file_is_already_open, * GoSub, New_File HE_OpenFile(hEdit, out_put_var) Return Open_File: { Gui, 98:+OwnDialogs FileSelectFile, fn if Errorlevel return HE_OpenFile(hEdit, fn) Return } Save_Close_File: file_name_full := He_GetFileName(hEdit) IfInString, file_name_full, * { GoSub, Save_File HE_CloseFile(hEdit, -1) Return } else HE_SaveFile(hEdit, file_name_full) LV_Delete() LOAD_FILES() Fill_ListView() HE_CloseFile(hEdit, -1) Return Close_file: HE_CloseFile(hEdit, -1) Return Delete_File: out_put_var := HE_GetFileName(hEdit) If (InStr(out_put_var, "*") != 0) Return MsgBox, 4, DELETE SCRIPT, DO YOU WANT TO DELETE`n`n%out_put_var% IfMsgBox Yes FileDelete, %out_put_var% else Return HE_CloseFile(hEdit) LV_Delete() LOAD_FILES() Fill_ListView() Return New_File: { HE_NewFile(hEdit) Return } Save_File: { Gui, 98:+OwnDialogs file_name_full := HE_GetFileName(hEdit) If (A_ThisHotkey = "^S" or InStr(A_ThisMenuItem, "CTRL && S") != 0) { If InStr(file_name_full, "*") = 0 { HE_SaveFile(hEdit, file_name_full) Return } } else file_is_file := RegExMatch(file_name_full, "\.[a-zA-Z0-9_]+$", file_ext) If (InStr(file_name_full, "*") != 0) FileSelectFile, fn, S 16, %script_path%, Save As, *.* else FileSelectFile, fn, S 16, %file_name_full%, Save As, *.* If Errorlevel = 1 return SplitPath, fn, script_name, script_dir StringLeft, script_name, script_name, InStr(script_name, ".")-1 If (RegExMatch(script_name, "^\w+$") != 0) { If (%script_name% != fn and script_dir = script_path and %script_name% != "") { script_name := %script_name% MsgBox, 4, REPLACE SCRIPT, DO YOU WANT TO REPLACE SCRIPT:`n`n%script_path%\%script_name%`n`nWITH`n`n%fn% IfMsgBox No { MsgBox, 4, SAVE ANYWAY, DO YOU WANT TO SAVE ANYWAY IfMSgBox No Return } else { FileDelete, %script_path%\%script_name% } } } HE_SaveFile(hEdit, fn, -1) LV_Delete() LOAD_FILES() Fill_ListView() return } Fill_ListView(){ Global Loop %script_count0% { script_name := script_count%A_Index% StringTrimLeft, script_name, %script_name%, InStr(%script_name%, ".") LV_Add("", script_count%A_Index%, script_name, script_count_size%A_Index%, script_count_accessed%A_Index%, script_count_modified%A_Index%, script_count_created%A_Index%) } LV_ModifyCol(1, 135) Return } Filter_ListView(term){ ;field = 0 all fields will be searched global local qm Transform, qm, Chr, 34 LV_Delete() If (SubStr(term, 1, 1) = qm and SubStr(term, 0, 1) = qm) { StringTrimLeft, term, term, 1 StringTrimRight, term, term, 1 Loop %script_count0% { script_name := script_count%A_Index% If (RegExMatch(%script_name%, term) != 0) { StringTrimLeft, script_name, %script_name%, InStr(%script_name%, ".") LV_Add("", script_count%A_Index%, script_name, script_count_size%A_Index%, script_count_accessed%A_Index%, script_count_modified%A_Index%, script_count_created%A_Index%) } } } else { Loop %script_count0% { script_name := script_count%A_Index% If (InStr(%script_name%, term) != 0) { StringTrimLeft, script_name, %script_name%, InStr(%script_name%, ".") LV_Add("", script_count%A_Index%, script_name, script_count_size%A_Index%, script_count_accessed%A_Index%, script_count_modified%A_Index%, script_count_created%A_Index%) } } } Return } Edit_Menu: Gui, 98:+OwnDialogs If (InStr(A_ThisMenuItem, "&Undo") != 0) HE_Undo(hEdit) else if (InStr(A_ThisMenuItem, "&Redo") != 0) HE_Redo(hEdit) else if (InStr(A_ThisMenuItem, "&Find") != 0) CmnDlg_Replace( hwnd, "OnFind" ) else if (InStr(A_ThisMenuItem, "Find &Next") != 0) FindNext(hEdit) else if (InStr(A_ThisMenuItem, "Go To") != 0) GoToLine() else if (InStr(A_ThisMenuItem, "&Copy") != 0) Send, ^c else if (InStr(A_ThisMenuItem, "&Paste") != 0) Send, ^v else if (InStr(A_ThisMenuItem, "C&ut") != 0) Send, ^x else if (inStr(A_ThisMenuItem, "&Select Script") != 0) { GuiControlGet, out_put_var, FocusV If out_put_var = GuiControl, Focus, Script_list_view else ControlFocus, HiEdit1, ahk_id %hwnd% } else if A_ThisMenuItem = &Font { if CmnDlg_Font(fFace, fStyle, pColor, true, hwnd) HE_SetFont(hEdit, fStyle "," fFace) } else if A_ThisMenu = WebBrowser { If A_ThisMenuItem = &Internet Explorer { IniWrite, %A_ProgramFiles%\Internet Explorer\iexplore.exe, %A_ScriptName%, CONFIG, setwebbrowser webbrowserfile = %A_ProgramFiles%\Internet Explorer\iexplore.exe Menu, Webbrowser, Uncheck, &Other WebBrowser Menu, Webbrowser, Check, &Internet Explorer } else { FileSelectFile, new_webbrowserfile, 2,%A_ProgramFiles%\, Select your default Webbrowser, *.exe If (FileExist(new_webbrowserfile)= "") { MsgBox, Error opening file`nfile: %new_webbrowserfile%`ndoes not exists. } else { webbrowserfile = %new_webbrowserfile% IniWrite, %webbrowserfile%, %A_ScriptName%, CONFIG, setwebbrowser Menu, Webbrowser, Check, &Other WebBrowser Menu, Webbrowser, Uncheck, &Internet Explorer } } } else if A_ThisMenu = AutoStart { StringReplace, autostarton, A_ThisMenuItem, & IniWrite, %autostarton%, %A_ScriptName%, CONFIG, setautostart Menu, AutoStart, Uncheck, &ON Menu, AutoStart, Uncheck, O&FF Menu, AutoStart, Uncheck, &ASK Menu, AutoStart, Check, %A_ThisMenuItem% } else if A_ThisMenu = WorkingDir { FileSelectFolder, new_script_path, , 1, SELECT NEW SCRIPT PATH If ErrorLevel = 1 Return else { Menu, WorkingDir, Rename, %script_path%`t&Click to change, %new_script_path%`t&Click to change script_path = %new_script_path% new_script_path= IniWrite, %script_path%, %A_ScriptName%, CONFIG, setscriptpath MsgBox, 4, RELOAD, DO YOU WANT TO RELOAD %ScriptName_A% IfMsgBox Yes Reload } } else if A_ThisMenuItem = About MsgBox, 0,About, SCRIPT MANAGER`n`nWritten by HotKeyIt`n`nVersion 1.00 else if A_ThisMenuItem = Help Goto, Help_Box else if A_ThisMenuItem = &Edit AutoHotkey.ini HE_OpenFile(hEdit, "AutoHotkey.ini") else if A_ThisMenuItem = Ne&xt File`tCTRL && PgDn { total_files := HE_GetFileCount(hEdit) total_files-- If total_files = 0 Return current_file := HE_GetCurrentFile(hEdit) current_file++ If (current_file > total_files) current_file = 0 HE_SetCurrentFile(hEdit, current_file) } else if A_ThisMenuItem = Pre&vious File`tCTRL && PgUp { total_files := HE_GetFileCount(hEdit) total_files-- If total_files = 0 Return current_file := HE_GetCurrentFile(hEdit) current_file-- If current_file < 0 HE_SetCurrentFile(hEdit, total_files) else HE_SetCurrentFile(hEdit, current_file) } else if A_ThisMenuItem = In&sert All { StringReplace, Instant_script, Instant_script, ``n, `n, A ControlFocus, HiEdit1, ahk_id %hwnd% SendRaw % instant_script Send, {ENTER} } else if A_ThisMenuItem = Set &Instant Script (current file) { MsgBox, 4, SET INSTANT SCRIPT, REPLACE INSTANT SCRIPT`nWITH CURRENT TEXT IfMsgBox NO Return ControlGetText, out_put_var, HiEdit1, ahk_id %hwnd% StringReplace, out_put_var, out_put_var, `r`n, ``n, All IniWrite, %out_put_var%, %A_ScriptName%, CONFIG, setinstandusedscript MsgBox, 4, RELOAD?, YOU NEED TO RELOAD TO UPDATE MENU`nRELOAD NOW? IfMsgBox Yes Reload } else if A_ThisMenu = InstantScript { ControlFocus, HiEdit1, ahk_id %hwnd% SendRaw % A_ThisMenuItem Send, {ENTER} } else if A_ThisMenuItem = Re&name File { current_file_name := HE_GetFileName(hEdit) If (InStr(current_file_name, "*") != 0) Return SplitPath, current_file_name,current_script_name, script_dir InputBox, new_file_name, ENTER NEW FILENAME,,, 300, 100,,,,,%current_script_name% If (current_file_name = new_file_name or Errorlevel = 1) Return MsgBox, 4, RENAME SCRIPT, DO YOU WANT TO RENAME:`n`n%current_file_name%`n`nTO`n`n%script_dir%\%new_file_name% IfMsgBox Yes { FileDelete, %current_file_name% new_file_name := script_dir . "\" . new_file_name HE_SaveFile(hEdit, new_file_name) LV_Delete() LOAD_FILES() Fill_ListView() } } else if A_ThisMenuItem = Set F&ilter { InputBox, search_term, ENTER SEARCHTERM, ENTER YOUR SEARCH TERM`n!!!Enable RegExMatch using "" e.g. "\s"!!!,,260,140,,,,,%search_term% Filter_ListView(search_term) } else if A_ThisMenuItem = S&how Files List { HE_ShowFileList( hEdit ,20, 50) } else if A_ThisMenu = Suggest { Loop 12 Menu, suggest, Uncheck, %A_Index% Menu, suggest, Check, %A_ThisMenuItem% suggest_times = %A_ThisMenuItem% IniWrite, %A_ThisMenuItem%, %A_ScriptName%, CONFIG, setsuggesttimes } else if A_ThisMenuItem = SET &KEYWORD LAUNCHER COLOR { InputBox, kwlaunch_color, NEW GUI COLOR, ENTER NEW COLOR`n(BGR FORMAT 0xFFFF80),,180, 140,,,,,%kwlaunch_color% IniWrite, %kwlaunch_color%, %A_ScriptName%, CONFIG, setkwlaunchcolor } else if A_ThisMenu = CommandSuggestamount { Menu, CommandSuggestamount, Uncheck, 0 Loop 9 Menu, CommandSuggestamount, Uncheck, %A_Index% command_suggest_amount = %A_ThisMenuItem% IniWrite, %A_ThisMenuItem%, %A_ScriptName%, CONFIG, setcommandsuggestamount Menu, CommandSuggestamount, Check, %A_ThisMenuItem% } else if A_ThisMenu = fromwhichletter { Menu, fromwhichletter, Uncheck, 2 Menu, fromwhichletter, Uncheck, 3 Menu, fromwhichletter, Uncheck, 4 Menu, fromwhichletter, Uncheck, 5 command_suggest_from = %A_ThisMenuItem% IniWrite, %A_ThisMenuItem%, %A_ScriptName%, CONFIG, setcommandsuggestfrom Menu, fromwhichletter, Check, %A_ThisMenuItem% } else if A_ThisMenu = Commandsuggest { If A_ThisMenuItem = &ALWAYS SHOW ON { Menu, CommandSuggest, Check, &ALWAYS SHOW ON Menu, CommandSuggest, UnCheck, &ALWAYS SHOW OFF IniWrite, ON, %A_ScriptName%, CONFIG, setcommandsuggestalways } else { Menu, CommandSuggest, Check, &ALWAYS SHOW OFF Menu, CommandSuggest, UnCheck, &ALWAYS SHOW ON IniWrite, OFF, %A_ScriptName%, CONFIG, setcommandsuggestalways } } Return SetColors(hEdit) { colors= ( Text = 0 Back = 0xFFFFFF SelText = 0xFFFFFF ActSelBack = 0xc56a31 InSelBack = 0xAAAAAA LineNumber = 0x0 SelBarBack = 0xFFCCCC NonPrintableBack = 0xFFFFFF Number = 0x0000FF ) HE_SetColors(hEdit, colors ) } ;This will display command suggest tooltip OnHiEdit: SetTimer, RemoveTooltip, Off ;ToolTip, %HE_EVENT%,500,0,5 If (HE_EVENT = "key") { ;ToolTip, in`n%HE_EVENT%`n%HE_INFO%`nhelp:`t%help_displ%`nlast:`t%HE_INFO_LAST%, 0, 100, 3 ;MsgBox % HE_INFO_LAST "`n" help_displ If (help_displ = "" and (HE_INFO = "`t" or HE_INFO = "`n")) { ;ToolTip, 0, 0, 0 HE_INFO_LAST = Return } If (RegexMatch(HE_INFO, "[a-zA-Z0-9,-_""§%&/=~#'<>°;:!\\\.\*\?\+\[\{\}\|\(\)\^\$\s]") = 0) Return If (RegexMatch(HE_INFO, "^\d$") != 0 or HE_INFO = "`t") { If (RegExMatch(help_Displ, HE_INFO . "\s") or HE_Info = "`t") { If (HE_Info = "`t" and RegExMatch(help_displ, "^\d") = 0) insert_command := SubStr(help_displ, 1, InStr(help_displ, "`n")-1) else if ((HE_Info = "`t" and RegExMatch(help_displ, "^\d") != 0)) insert_command := SubStr(help_displ, 3) else insert_command := SubStr(help_Displ, RegExMatch(help_Displ, HE_INFO . "\s")+2) ;ToolTip % insert_command "`n" help_Displ,100, 50, 3 If (StrLen(RegExReplace(line,"^\t*\s*|^\s*\t*", "")) < StrLen(SubStr(help_Displ, 1, RegExMatch(help_Displ, ",|\[|\(|\R")))) ;HE_INFO2 - HE_LineIndex(hEdit) { reg_ex_search := InStr(insert_command, "(") reg_ex_search2 := InStr(insert_command, "[") reg_ex_search3 := InStr(insert_command, ",") ;ToolTip % reg_ex_search "`n`n" reg_ex_search2 "`n`n" reg_ex_search3, 10, 50, 2 If((((reg_ex_search3 < reg_ex_search) or reg_ex_search = 0) and ((reg_ex_search3 < reg_ex_search2) or reg_ex_search2 = 0)) and reg_ex_search3 != 0) { ;ToolTip, 1,0,0 Send % "^+{LEFT}" SubStr(insert_command, 1, RegExMatch(insert_command, ",")-1) ", " } else if (((reg_ex_search0 < reg_ex_search3 or reg_ex_search3 = 0) and (reg_ex_search < reg_ex_search2 or reg_ex_search2 = 0)) and reg_ex_search != 0) { ;Tooltip, 2`n%insert_command%,0,0 Send % "^+{LEFT}" SubStr(insert_command, 1, RegExMatch(insert_command, "\(")-1) "(" } else if ((reg_ex_search > reg_ex_search2 or reg_ex_search =0) and reg_ex_search2 != 0) { ;ToolTip, 3, 0,0 Send % "^+{LEFT}" SubStr(insert_command, 1, RegExMatch(insert_command, "\[")-2) ", " } else { IfInString, insert_command, `n, StringLeft, insert_command, insert_command, InStr(insert_command, "`n")-1 Send % "^+{LEFT}" insert_command } HE_INFO_LAST = i ;Tooltip Return } } } HE_INFO_LAST = k SetTimer, RemoveToolTip, 15000 Return } else if HE_INFO_LAST = i Send, {BackSpace} else if (command_suggest_amount = 0 or HE_LineLength(hEdit) > 150 or HE_LineLength(hEdit) < command_suggest_from or SubStr(HE_INFO, 0, 1) = "t" or (HE_INFO_LAST != "k" and command_suggest_always != "ON")) { HE_INFO_LAST = GoTo, RemoveToolTip } StringSplit, HE_INFO, HE_INFO, %A_SPACE%, S E L HE_INFO_LAST = line_full := HE_GetLine(hEdit, HE_INFO3) If RegExMatch(line_full, "\s\;") StringLeft, line_full, line_full, RegExMatch(line_full, "\s\;")-1 If InStr(line_full, ",") Stringleft, line, line_full, InStr(line_full, ",")-1 else line := line_full If RegExMatch(line_full, "^\w+\s%") StringLeft, line, line_full, InStr(line_full, " %")-2 else if RegExMatch(line_full, "^\w+\(") StringLeft, line, line_full, InStr(line_full, "(")-1 ;MsgBox % line "`n`n" InStr(ahk_commands, "|" . RegExReplace(line, "^\t|^\s","")) "`n`n" ahk_commands If (InStr(ahk_commands, "|" . RegExReplace(line, "^\t*\s*|^\s*\t*","")) = 0 or RegExReplace(line, "^\t*\s*|^\s*\t*","") = "") Goto, RemoveToolTip help_displ = count=0 StringTrimLeft, help_tmp, ahk_commands, InStr(ahk_commands, "|" . RegExReplace(line, "^\t*\s*|^\s*\t*","")) Loop %command_suggest_amount% { helpdispltemp := SubStr(help_tmp, 1, InStr(help_tmp, "|")-1) If (InStr(help_tmp, "|" . RegExReplace(line, "^\t*\s*|^\s*\t*","")) = 0 or InStr(line_full, ",") !=0) { If A_Index = 1 { If (InStr(line_full, ",") or InStr(line_full, "(")) { StringReplace, command_suggest_tmp_%helpdispltemp%, command_suggest_%helpdispltemp%, [,,A StringReplace, command_suggest_tmp_%helpdispltemp%, command_suggest_tmp_%helpdispltemp%, ],,A } else command_suggest_tmp_%helpdispltemp% := command_suggest_%helpdispltemp% StringSplit, command_suggest_tmp_%helpdispltemp%, command_suggest_tmp_%helpdispltemp%, `,(, %A_Space%%A_Tab% line_full_tmp := RegExReplace(line_full, "\s%\s", ",","",1) StringSplit, line_full_tmp, line_full_tmp, `,(), %A_Space%%A_Tab% ;MsgBox % line_full_tmp "`n" command_suggest_tmp_%helpdispltemp%0 If (command_suggest_tmp_%helpdispltemp%0 > 0 and line_full_tmp0 > 0) { help_Displ = looptimes := command_suggest_tmp_%helpdispltemp%0 Loop %looptimes% { ;MsgBox % command_suggest_tmp_%helpdispltemp%%A_Index% "`n" line_full_tmp%A_Index% If A_Index = 2 { reg_ex_search := SubStr(command_suggest_tmp_%helpdispltemp%, RegExMatch(command_suggest_tmp_%helpdispltemp%, "\s|\("), 1) If (reg_ex_search = "(" and A_Index = 2) help_Displ .= "(" else if (reg_ex_search = "(" and A_Index = looptimes) { help_displ .= ")" } else if RegExMatch(line_full, "^\w+\s%") help_displ .= " % " else help_Displ .= ", " } else if A_Index >1 { help_Displ .= ", " } ;MsgBox % A_Index "`n" line_full_tmp%A_Index% If (line_full_tmp%A_Index% = "" and A_Index = line_full_tmp0) { help_Displ .= " <" . command_suggest_tmp_%helpdispltemp%%A_Index% . ">" } else if (line_full_tmp%A_Index% = "" or A_Index = 1) { help_Displ .= command_suggest_tmp_%helpdispltemp%%A_Index% } else { help_Displ .= line_full_tmp%A_Index% . " <" . command_suggest_tmp_%helpdispltemp%%A_Index% . ">" } ;If (A_Index = looptimes and InStr(command_suggest_%helpdispltemp%, "[") != 0 and line_full_tmp%A_Index% != "") ; help_displ .= "]" reg_ex_search := SubStr(command_suggest_tmp_%helpdispltemp%, RegExMatch(command_suggest_tmp_%helpdispltemp%, ",|\s|\("), 1) If (reg_ex_search = "(" and A_Index = looptimes and line_full_tmp%A_Index% != "") { If ( InStr(help_displ, ")") = 0 ) help_displ .= ")" } If (InStr(line_full_tmp, "(") and InStr(line_full_tmp, ")") and (A_Index = line_full_tmp0)) { help_displ := line_full_tmp break } } Loop %looptimes% { line_full_tmp%A_Index% = command_suggest_tmp_%helpdispltemp%%A_Index% = command_suggest_%helpdispltemp%%A_Index% = } help_displ .= "`n`n" . command_suggest_info_%helpdispltemp% } else help_displ .= count . A_Space . command_suggest_%helpdispltemp% } else help_displ .= "`n" count . A_Space . command_suggest_%helpdispltemp% break } If A_Index > 1 help_Displ .= "`n" help_Displ .= count . A_Space . command_suggest_%helpdispltemp% StringTrimLeft, help_tmp, help_tmp, InStr(help_tmp, "|") count++ } ToolTip % help_Displ,,,17 SendMessage, 0x400+19, kwlaunch_color,"0x0",, AHK_class tooltips_class32 SetTimer, RemoveToolTip, 15000 Return RemoveToolTip: SetTimer, RemoveToolTip, Off help_displ= ToolTip,,,,17 Return ;Hides and unhides the active window 1Inlcude_winhider: Return mwt_Minimize: { ToolTip if mwt_WindowCount >= %mwt_MaxWindows% { MsgBox No more than %mwt_MaxWindows% may be hidden simultaneously. return } WinWait, A,, 2 if ErrorLevel <> 0 ; It timed out, so do nothing. return WinGet, mwt_ActiveID, ID WinGetTitle, mwt_ActiveTitle WinGetClass, mwt_ActiveClass if mwt_ActiveClass in Shell_TrayWnd,Progman { MsgBox The desktop and taskbar cannot be hidden. return } Send, !{esc} WinHide if mwt_ActiveTitle = mwt_ActiveTitle = ahk_class %mwt_ActiveClass% StringLeft, mwt_ActiveTitle, mwt_ActiveTitle, %mwt_MaxLength% Loop, %mwt_MaxWindows% { if mwt_WindowTitle%a_index% = %mwt_ActiveTitle% { ; Match found, so it's not unique. ; First remove the 0x from the hex number to conserve menu space: StringTrimLeft, mwt_ActiveIDShort, mwt_ActiveID, 2 StringLen, mwt_ActiveIDShortLength, mwt_ActiveIDShort StringLen, mwt_ActiveTitleLength, mwt_ActiveTitle mwt_ActiveTitleLength += %mwt_ActiveIDShortLength% mwt_ActiveTitleLength++ ; +1 the 1 space between title & ID. if mwt_ActiveTitleLength > %mwt_MaxLength% { ; Since menu item names are limted in length, trim the title ; down to allow just enough room for the Window's Short ID at ; the end of its name: TrimCount = %mwt_ActiveTitleLength% TrimCount -= %mwt_MaxLength% StringTrimRight, mwt_ActiveTitle, mwt_ActiveTitle, %TrimCount% } ; Build unique title: mwt_ActiveTitle = %mwt_ActiveTitle% %mwt_ActiveIDShort% break } } mwt_AlreadyExists = n Loop, %mwt_MaxWindows% { if mwt_WindowID%a_index% = %mwt_ActiveID% { mwt_AlreadyExists = y break } } if mwt_AlreadyExists = n { Menu, Tray, add, %mwt_ActiveTitle%, RestoreFromTrayMenu mwt_WindowCount++ Loop, %mwt_MaxWindows% ; Search for a free slot. { ; It should always find a free slot if things are designed right. if mwt_WindowID%a_index% = ; An empty slot was found. { mwt_WindowID%a_index% = %mwt_ActiveID% mwt_WindowTitle%a_index% = %mwt_ActiveTitle% break } } } return } RestoreFromTrayMenu: { Menu, Tray, delete, %A_ThisMenuItem% ; Find window based on its unique title stored as the menu item name: Loop, %mwt_MaxWindows% { if mwt_WindowTitle%a_index% = %A_ThisMenuItem% ; Match found. { StringTrimRight, IDToRestore, mwt_WindowID%a_index%, 0 WinShow, ahk_id %IDToRestore% WinActivate ahk_id %IDToRestore% ; Sometimes needed. mwt_WindowID%a_index% = ; Make it blank to free up a slot. mwt_WindowTitle%a_index% = mwt_WindowCount-- break } } return } mwt_UnMinimize: { if mwt_WindowCount > 0 { ;; Get the id of the last window minimized and unhide it StringTrimRight, IDToRestore, mwt_WindowID%mwt_WindowCount%, 0 WinShow, ahk_id %IDToRestore% WinActivate ahk_id %IDToRestore% ;; Get the menu name of the last window minimized and remove it StringTrimRight, MenuToRemove, mwt_WindowTitle%mwt_WindowCount%, 0 Menu, Tray, delete, %MenuToRemove% ;; clean up our 'arrays' and decrement the window count mwt_WindowID%mwt_WindowCount% = mwt_WindowTitle%mwt_WindowCount% = mwt_WindowCount-- } return } mwt_RestoreAllThenExit: { DllCall("gdi32.dll\DeleteObject", UInt,h_region ) DllCall("gdi32.dll\DeleteObject", UInt,hbm_buffer) DllCall("gdi32.dll\DeleteDC", UInt,hdc_frame ) DllCall("gdi32.dll\DeleteDC", UInt,hdc_buffer) Gosub, mwt_RestoreAll ExitApp ; Do a true exit. } mwt_RestoreAll: { Loop, %mwt_MaxWindows% { if mwt_WindowID%a_index% <> { StringTrimRight, IDToRestore, mwt_WindowID%a_index%, 0 WinShow, ahk_id %IDToRestore% WinActivate ahk_id %IDToRestore% ; Sometimes needed. ; Do it this way vs. DeleteAll so that the sep. line and first ; item are retained: StringTrimRight, MenuToRemove, mwt_WindowTitle%a_index%, 0 Menu, Tray, delete, %MenuToRemove% mwt_WindowID%a_index% = ; Make it blank to free up a slot. mwt_WindowTitle%a_index% = mwt_WindowCount-- } if mwt_WindowCount = 0 break } return } ;End of WinHider ;CAPSLOCK & SHIFT 1Include_fileexplorer: Return FILEEXPLORER: { KeyWait, SHIFT KeyWait, CAPSLOCK SetCapsLockState, Off ToolTip,,,,20 count = 0 explorervar = explorersearchagain = explorersearchsubfolders = 0 explorersearchfile = 2 explorerpressedspace = Loop { If explorervar = { ToolTip, FILE- AND FOLDER STARTER`n-------------------------`nENTER DRIVE & FOLDER`nPRESS F1 TO ENTER A VARIABLE,,,18 SendMessage, 0x400+19, kwlaunch_color,"0x0",, AHK_class tooltips_class32 } else { ToolTip, %explorervar%`n--------------------`nTAB = TAKE OVER PATH`nENTER = OPEN FILE/FOLDER`nF12(%explorersearchfile%): 0=FILES | 2=FOLDERS`nF11(%explorersearchsubfolders%): SEARCH SUBFOLDERS,,,18 } If explorersearchagain = { Input, explorerstring, L1, {ENTER}{ESC}{BS}{F12}{F11}{F4}{F1}{Space}{DOWN}{LEFT} } else if explorersearchagain = 1 { Errorlevel = Max } If Errorlevel = EndKey:Space explorerpressedspace = 1 ;MsgBox, %Errorlevel% If Errorlevel = Max { If explorervar = { If explorerstring = \ { explorervar = \\ } else { explorervar = %explorerstring%`:`\ } } else if explorersearchagain = { If explorerpressedspace = { explorervar = %explorervar%%explorerstring% } else { explorervar = %explorervar%%A_Space%%explorerstring% explorerpressedspace = } } explorerloopagain: explorersearchagain = ToolTip, SEARCHING....`nPLEASE WAIT...,,,18 Loop, %explorervar%*.*, %explorersearchfile%, %explorersearchsubfolders% { If A_LoopFileSize > 0 { ToolTip, %explorervar%`n--------------------`n%A_LoopFileLongPath%`n--------------------`nTAB = TAKE OVER PATH`nENTER = OPEN FILE/FOLDER`nF12(%explorersearchfile%): 0=FILES | 2=FOLDERS`nF11(%explorersearchsubfolders%): SEARCH IN SUBFOLDERS,,,18 } else { ToolTip, %explorervar%`n--------------------`n%A_LoopFileLongPath%`\`n--------------------`nTAB = TAKE OVER PATH`nENTER = OPEN FILE/FOLDER`nF12(%explorersearchfile%): 0=FILES | 2=FOLDERS`nF11(%explorersearchsubfolders%): SEARCH SUBFOLDERS,,,18 } Input, loopfileweiter, L1, {ENTER}{BS}{ESC}{TAB}{DOWN}{UP}{F12}{F11}{Space}{LEFT} If Errorlevel = EndKey:Tab { If A_LoopFileSize > 0 { explorervar = %A_LoopFileLongPath% } else { explorervar = %A_LoopFileLongPath%\ } explorersearchagain = 1 break } else if Errorlevel = EndKey:Space { explorerpressedspace = 1 } else if Errorlevel = EndKey:Down { ToolTip, SEARCHING....`nPLEASE WAIT...,,,18 continue } else if Errorlevel = EndKey:Up { explorersearchagain = 1 break } else if Errorlevel = EndKey:F11 { If explorersearchsubfolders = 0 { explorersearchsubfolders = 1 } else { explorersearchsubfolders = 0 } explorersearchagain = 1 break } else if Errorlevel = EndKey:F12 { If explorersearchfile = 0 explorersearchfile = 2 else { explorersearchfile = 0 } ;else if explorersearchfile = 1 ;{ ;explorersearchfile = 2 ;} explorersearchagain = 1 break } else if Errorlevel = EndKey:Left { StringTrimRight, explorervar, explorervar, 1 explorersearchagain = 1 break } else if Errorlevel = EndKey:Backspace { StringRight, explorervarcutoff, ecplorervar, 1 If explorervarcutoff = \ { StringGetPos, explorervarcutoff, explorervar, \, R2, 1 } else { StringGetPos, explorervarcutoff, explorervar, \, R, 1 } explorervarcutoff += 1 StringLeft, explorervar, explorervar, %explorervarcutoff% ;Stringtrimright, explorervar, explorervar, 1 If explorervar = { explorersearchagain = } else if explorervar = :\ { explorervar = explorersearchagain = } else { explorersearchagain = 1 } explorerpressedspace = break } else if Errorlevel = Max { If explorerpressedspace = 1 { explorervar = %explorervar%%A_Space%%loopfileweiter% } else { explorervar = %explorervar%%loopfileweiter% } explorerpressedspace = explorersearchagain = 1 break } else if Errorlevel = EndKey:Enter { If A_LoopFileSize = 0 { ToolTip,,,,18 StringRight, whichfoldertorun, explorervar, 1 If whichfoldertorun = \ { saveexprorervar = %explorervar% saveexplorersearchfile = 2 Run %A_windir%\explorer.exe /e`, %explorervar% } else { saveexplorervar = %A_LoopFileLongPath% saveexplorersearchfile = 2 Run %A_windir%\explorer.exe /e`, %A_LoopFileLongPath% } Return } else if A_LoopFileSize > 0 { saveexplorervar = %A_LoopFileLongPath% saveexplorersearchfile = 0 ToolTip,,,,18 Run %A_LoopFileLongPath% Return } explorersearchagain = 1 Break } else if Errorlevel = EndKey:Escape { ToolTip,,,,18 Return } } } else if ErrorLevel = EndKey:F1 { Loop { IfEqual, environmentvariablevar, , ToolTip, ENTER A VARIABLE - THEN ENTER OR TAB AND PATH WILL BE CHOOSEN,,,18 IfNotEqual, environmentvariablevar, , ToolTip, %environmentvariablevar%,,,18 Input, environmentvariable, L1, {ENTER}{ESC}{BACKSPACE}{TAB} If Errorlevel = Max { environmentvariablevar = %environmentvariablevar%%environmentvariable% continue } else if (Errorlevel = "EndKey:Enter" or Errorlevel = "EndKey:Tab") { EnvGet, explorervar, %environmentvariablevar% If explorervar = { If environmentvariablevar is alnum { environmentvariablevarislocal := %environmentvariablevar% IfNotExist, %environmentvariablevarislocal% { environmentvariablevarislocal := %environmentvariablevar%2 IfExist, %environmentvariablevarislocal% explorervar = %environmentvariablevarislocal% } else { If environmentvariablevar is alnum explorervar := %environmentvariablevar% } } } If (InStr(explorervar, ".") = "0" and RegExMatch(explorervar, "\\$") = "0") explorervar = %explorervar%\ else explorersearchfile = 0 environmentvariablevar = explorersearchagain = 1 break } else if Errorlevel = EndKey:Escape { explorersearchagain = environmentvariablevar = break } else if Errorlevel = EndKey:Backspace { environmentvariablevar = } } } else if Errorlevel = EndKey:F4 { explorervar = %saveexplorervar% explorersearchfile = %saveexplorersearchfile% explorersearchagain = 1 } else if Errorlevel = EndKey:Down { ToolTip, SEARCHING....`nPLEASE WAIT...,,,18 explorersearchagain = 1 continue } else if Errorlevel = EndKey:Left { StringTrimRight, explorervar, explorervar, 1 explorersearchagain = 1 continue } else if Errorlevel = EndKey:Backspace { StringRight, explorervarcutoff, ecplorervar, 1 If explorervarcutoff = \ { StringGetPos, explorervarcutoff, explorervar, \, R2, 1 } else { StringGetPos, explorervarcutoff, explorervar, \, R, 1 } explorervarcutoff += 1 StringLeft, explorervar, explorervar, %explorervarcutoff% ;Stringtrimright, explorervar, explorervar, 1 If explorervar = { explorersearchagain = } else if explorervar = :\ { explorervar = explorersearchagain = } else { explorersearchagain = 1 } explorerpressedspace = } else if Errorlevel = EndKey:F11 { If explorersearchsubfolders = 0 { explorersearchsubfolders = 1 } else { explorersearchsubfolders = 0 } explorersearchagain = 1 } else if Errorlevel = EndKey:F12 { If explorersearchfile = 0 explorersearchfile = 2 else ;if explorersearchfile = 1 { explorersearchfile = 0 } ;else ;{ ;explorersearchfile = 0 ;} explorersearchagain = 1 } else if Errorlevel = EndKey:Escape { ToolTip,,,,18 Return } else if Errorlevel = EndKey:Enter { StringRight, explorervarpath, explorervar, 1 If explorervarpath = `\ { saveexplorervar = %explorervar% ToolTip,,,,18 Run %A_windir%\explorer.exe /e`, %explorervar% Return } explorersearchagain = 1 } } ToolTip,,,,18 Return } ;end of Fileexplorer ;This is launched when in keyword launcher entry no script was found ;it determines if it is an IP address or drive or looks for the entry on google I'm feeling lucky 1Include_go: Return GO: { StringSplit, ip, outrunvar, ., . StringLeft, first, outrunvar, 1 StringRight, last, outrunvar, 1 EnvGet, GoVariable, %outrunvar% StringLeft, ziel, outrunvar, 2 StringRight, ziel1, ziel, 1 StringLeft, vgoogle, outrunvar, 1 StringTrimLeft, vgoogle2, outrunvar, 1 StringLeft, iswebsite, outrunvar, 4 If GoVariable = { If outrunvar = intranet { Run %webbrowserfile% http://intranet/ } else if ziel1 = : { Run explorer /e`, %outrunvar% } else if vgoogle = . { Run %webbrowserfile% "http://www.google.de/search?hl=de&q=%vgoogle2%&meta=" } else if vgoogle = ? { Run %webbrowserfile% "http://dict.leo.org/ende?lp=ende&lang=de&searchLoc=0&cmpType=relaxed§Hdr=on&spellToler=on&search=%vgoogle2%&relink=on" } else if vgoogle = = { Calculate(vgoogle2) } else if vgoogle = - { Run %webbrowserfile% "http://search-desc.ebay.de/search/search.dll?satitle=%vgoogle2%&fts=2" } else if vgoogle = : { Run %webbrowserfile% "http://www.hardwareecke.de/preisvergleich/index.php?site=search.jsp&name=%vgoogle2%&Submit=suchen&navCategoryID=11&priceRangeFrom=&priceRangeTo=" } else if ziel = \\ { Run explorer %outrunvar% } else if ip0 = 4 { Run %webbrowserfile% %outrunvar% } else if iswebsite = http { Run %webbrowserfile% %outrunvar% } else { Run %webbrowserfile% "http://www.google.de/search?hl=de&q=%outrunvar%&btnI=Auf+gut+Glck&meta=" } } else { StringLeft, iswebsite, GoVariable, 4 If iswebsite = http { Run %webbrowserfile% %GoVariable% } else { Run explorer /e`, %GoVariable% } } Sleep, 300 ToolTip, return } ;end of Go ;This is used for calculation, as soon as I have time I will include a proper calculate function this I have written long ago and it is far not perfect 1Include_calculator: Return Calculate(vgoogle2){ delvalue = 0 Loop, 20 { ZAHL%delvalue% = 0 ZEICHEN%delvalue% = 0 delvalue += 1 } StringSplit, ZAHL, vgoogle2, "+" "*" "/" "-", StringSplit, ZEICHEN, vgoogle2, , 1 2 3 4 5 6 7 8 9 0 `. `, `% ;MsgBox, Zahlen: %ZAHL0%, Zeichen: %ZEICHEN0% n = 1 c = 0 lastpos = 0 Save = 0 If ZAHL1 contains `, StringReplace, ZAHL1, ZAHL1, `,, ., If ZAHL1 contains `% { StringTrimRight, percent1, ZAHL1, 1 percent1 *= 0.01 ZAHL1 := percent1 } If ZAHL1 is not float ZAHL1 *= 1.00 E := ZAHL1 Loop, %ZEICHEN0% { n += 1 c += 1 If ZAHL%c% contains `, StringReplace, ZAHL%c%, ZAHL%c%, `,, ., If ZAHL%n% contains `, StringReplace, ZAHL%n%, ZAHL%n%, `,, ., If ZAHL%n% contains `% { StringTrimRight, percent, ZAHL%n%, 1 percent *= 0.01 ZAHL%n% := percent } If ZAHL%c% is not float ZAHL%c% *= 1.00 If ZAHL%n% is not float ZAHL%n% *= 1.00 if ZEICHEN%n% contains *,/ { if ZEICHEN%c% contains *,/ { if ZEICHEN%c% = * { E *= ZAHL%n% } else { E /= ZAHL%n% } } else { Save += %E% lastpos = %c% E := ZAHL%n% Continue } } else if ZEICHEN%n% contains +,- { if ZEICHEN%c% = + { E += ZAHL%n% } else if ZEICHEN%c% = - { E -= ZAHL%n% } else if ZEICHEN%c% = * { E *= ZAHL%n% If ZEICHEN%lastpos% = + E += %Save% else if ZEICHEN%lastpos% = - { E *= -1 } E += %Save% Save = 0 } else if ZEICHEN%c% = / { E /= ZAHL%n% If ZEICHEN%lastpos% = + E += %Save% else if ZEICHEN%lastpos% = - { E *= -1 } E += %Save% Save = 0 } } If ZEICHEN%n% = 0 { if ZEICHEN%c% = * { ;MsgBox, %E% E *= ZAHL%n% ;MsgBox, %E% If ZEICHEN%lastpos% = + E += %Save% else if ZEICHEN%lastpos% = - { E *= -1 } ;E += %Save% Save = 0 } else if ZEICHEN%c% = / { E /= ZAHL%n% If ZEICHEN%lastpos% = + E += %Save% else if ZEICHEN%lastpos% = - { E := %Save% - %E% } Save = 0 } else if ZEICHEN%c% = - { E -= ZAHL%n% } else if ZEICHEN%c% = + { E += ZAHL%n% } } } Loop { StringRight, zahlr, E, 1 If zahlr = 0 StringTrimRight, E, E, 1 If zahlr = 0 { continue } else { If zahlr = . StringTrimRight, E, E, 1 break } } If E contains `. StringReplace, E, E, `., `,, MsgBox, %E% return } ;end of calculator ;AHK scripts Terminator section Update_Timer: SetTimer, Update_timer, Off WinMenuSelectItem, Process Terminator ahk_class AutoHotkeyGUI,, PROCESS, UPDATE Settimer, Update_timer, 1500 Return Update_processes: Process, Exist p_i_d_own = %Errorlevel% WinGet, p_i_d_own_name, ID, ahk_pid %p_i_d_own% WinGet, p_i_d_list, List, AHK_class AutoHotkey If p_i_d_list = 1 GoTo, 99GuiClose row_selected := LV_GetNext() LV_Delete() Loop %p_i_d_list% { p_i_d_var := p_i_d_list%A_Index% WinGet, p_i_d_list_pid, PID, ahk_id %p_i_d_var% If (p_i_d_own = p_i_d_list_pid) continue WinGetTitle, p_i_d_list%A_Index%, ahk_pid %p_i_d_list_pid% If (InStr(p_i_d_list%A_Index%, " - ") != 0) { StringLeft, p_i_d_list%A_Index%, p_i_d_list%A_Index%, InStr(p_i_d_list%A_Index%, " - ") SplitPath, p_i_d_list%A_Index%, p_i_d_list%A_Index% } If (InStr(p_i_d_list%A_Index%, "") != 0) { StringLeft, p_i_d_to_add_name, p_i_d_list%A_Index%, InStr(p_i_d_list%A_Index%, ".")-1 StringTrimLeft, p_i_d_list%A_Index%, p_i_d_list%A_Index%, InStr(p_i_d_list%A_Index%, ".") } LV_Add("", p_i_d_list_pid, p_i_d_to_add_name, p_i_d_list%A_Index%) p_i_d_to_add_name = } LV_ModifyCol(1, 80) LV_ModifyCol(2, 120) If row_selected != 0 { LV_Modify(row_selected, "Select") LV_Modify(row_selected, "Focus") LV_Modify(row_selected, "VIS") } Return Process_Terminator: ~^CTRLBREAK:: { ToolTip,,,,20 IfWinExist, Process Terminator ahk_class AutoHotkeyGui { Gui, 99:Show WinActivate, Process Terminator ahk_class AutoHotkeyGui Return } Gui, 99:+AlwaysOnTop +Resize Gui, 99:Default Menu, PROCESS, ADD, PROCESS, :UPDATEPROCESS Gui, 99:Menu, PROCESS Gui, font, bold Gui, 99:Add, Button, gTerminate_ALL w400, TERMINATE ALL Gui, font, norm Gui, 99:Add , ListView, r20 w400 Count50 cBlue Grid -Multi Sort +Readonly -WantF2 gTerminate, PID|Key|Description Process, Exist p_i_d_own = %Errorlevel% WinGet, p_i_d_own_name, ID, ahk_pid %p_i_d_own% WinGet, p_i_d_list, List, AHK_class AutoHotkey If p_i_d_list = 1 { MsgBox, 262144, NO PROCESSES FOUND,,0.7 Goto, 99GuiClose } Loop %p_i_d_list% { p_i_d_var := p_i_d_list%A_Index% WinGet, p_i_d_list_pid, PID, ahk_id %p_i_d_var% If (p_i_d_own = p_i_d_list_pid) continue WinGetTitle, p_i_d_list%A_Index%, ahk_pid %p_i_d_list_pid% If (InStr(p_i_d_list%A_Index%, " - ") != 0) { StringLeft, p_i_d_list%A_Index%, p_i_d_list%A_Index%, InStr(p_i_d_list%A_Index%, " - ") SplitPath, p_i_d_list%A_Index%, p_i_d_list%A_Index% } If (InStr(p_i_d_list%A_Index%, ".") != 0) { StringLeft, p_i_d_to_add_name, p_i_d_list%A_Index%, InStr(p_i_d_list%A_Index%, ".")-1 StringTrimLeft, p_i_d_list%A_Index%, p_i_d_list%A_Index%, InStr(p_i_d_list%A_Index%, ".") } LV_Add("", p_i_d_list_pid, p_i_d_to_add_name, p_i_d_list%A_Index%) p_i_d_to_add_name = } LV_ModifyCol(1, 80) LV_ModifyCol(2, 120) Gui, 99:Show,,Process Terminator SetTimer, Update_timer, 1500 Return } 99GuiEscape: 99GuiClose: SetTimer, Update_timer, Off Gui, 99:Destroy Return 99GuiSize: Anchor("SysListView321", "wh") Anchor("Button1", "w") Return Terminate: Gui, 99:+OwnDialogs If (A_GuiEvent = "DoubleClick" or A_ThisMenuItem = "Terminate") { out_put_var := LV_GetNext(0) If out_put_var = 0 Return LV_GetText(p_i_d_name, out_put_var, 2) LV_GetText(p_i_d_desc, out_put_var, 3) MsgBox, 262148, TERMINATE PROCESS, TERMINATE PROCESS?`n`nKEY: %p_i_d_name%`nNAME: %p_i_d_desc%, 5 IfMsgBox Yes { } else Return LV_GetText(p_i_d, out_put_var) ; Get the text from the row's first field. WinKill, ahk_pid %p_i_d% Process, WaitClose, %p_i_d%, 2 Process, Exist, %p_i_d% If (Errorlevel != 0) { MsgBox, 262148, PROCESS TERMINATOR, PROCESS COULD NOT BE TERMINATED`nKILL PROCESS? IfMsgBox Yes { Process, Close, %p_i_d% Process, WaitClose, %p_i_d%, 2 } Process, Exist, %p_i_d% If (Errorlevel != 0) { MsgBox, 262144, PROCESS KILLER, PROCESS COULD NOT BE KILLED } LV_Delete(out_put_var) } else { MsgBox, 262144, PROCESS TERMINATOR, PROCESS WAS TERMINATED, 0.5 LV_Delete(out_put_var) } LV_GetText(p_i_d, 1) If p_i_d = Goto, 99GuiClose } Return CAPSLOCK & PAUSE:: KeyWait, CAPSLOCK SetCapsLockState, Off Gui, 99:+OwnDialogs Terminate_ALL: { Gui, 99:Destroy Process, Exist p_i_d_own = %Errorlevel% WinGet, p_i_d_list, List, AHK_class AutoHotkey If p_i_d_list = 1 { MsgBox, 262144, NO PROCESSES FOUND,,0.7 GoTo, 99GuiClose } MsgBox, 262148, TERMINATE ALL PROCESSES?,, IfMsgBox Yes { Loop %p_i_d_list% { p_i_d_var := p_i_d_list%A_Index% WinGet, p_i_d_pid, PID, ahk_id %p_i_d_var% If(p_i_d_own = p_i_d_pid) continue WinKill, ahk_pid %p_i_d_pid% Process, WaitClose, %p_i_d_pid%, 2 Process, Exist, %p_i_d_pid% If (Errorlevel != 0) { MsgBox, 262148, PROCESS TERMINATOR, PROCESS COULD NOT BE TERMINATED`nKILL PROCESS? IfMsgBox Yes { Process, Close, %p_i_d_pid% Process, WaitClose, %p_i_d_pid%, 2 } Process, Exist, %p_i_d_pid% If (Errorlevel != 0) { MsgBox, 262144, PROCESS KILLER, PROCESS COULD NOT BE KILLED } } } MsgBox, 262144, ALL PROCESSES WERE TERMINATED,,0.5 } } Return ;End of Terminator ;Help Box section CAPSLOCK & F9:: KeyWait, Capslock SetCapsLockState, Off Help_Box: { ToolTip,,,,20 IfWinExist, HELP - SELECT TOPIC TO DISPLAY HELP { WinActivate, HELP - SELECT TOPIC TO DISPLAY HELP Return } Gui, 97:Default Gui, 97:+Resize Gui, 97:Add, ListView, r30 w150 Count50 NoSortHdr AltSubmit +ReadOnly Grid Multi gHelpchange, TOPIC Gui, 97:Add, Text, x+1, Description Gui, 97:Add, Edit, y+6 ReadOnly r32 w700 -Wrap, SCRIPT MANAGER`n`nVERSION 1`.00`n`nWRITER`: HotKeyIt LV_Add("", "GENERAL") LV_Add("", "SETTINGS") LV_Add("", "HOTKEYS") LV_Add("", "SPEEDHOTKEY") LV_Add("", "FILE/FOLDER STARTER") LV_Add("", "WINDOWHIDER") LV_Add("", "WININFO MENU") Gui, 97:Show, , HELP - SELECT TOPIC TO DISPLAY HELP Return } 97GuiSize: Anchor("Edit1", "wh") Anchor("SysListView321", "h") Return 97GuiClose: Gui, 97:Destroy Gui, Default Return 97GuiEscape: Gui, 97:Destroy Gui, Default Return Helpchange: { If A_GuiEvent = I IfInString, Errorlevel, S { If A_EventInfo = 1 GuiControl, , Edit1, SCRIPT MANAGER`n`nWITH SCRIPTMANAGER AND AUTOHOTKEY, YOUR WOKR WILL GET EASIER AND FASTER`n`n - NO BOTHERING SEARCHING FOR YOUR FILES AND FOLDERS - PRESS CAPSLOCK & SHIFT`n`n - START YOUR SCRIPT WITH A KEYWORD IN KEYWORD LAUNCHER (CAPSLOCK & TAB) OR WITH A HOTKEY (SEE TOPIC HOTKEYS)`n `n - AUTOSTART YOUR SCRIPTS / TERMINATE YOR SCRIPTS`n`n - GET INFORMATION ABOUT WINDOWS AND CONTROLS VERY QUICKLY (CAPSLOCK & F1)`n`n - IT IS THOUGHT TO USE THE FILE NAME AS A KEYWORD AND DESCRIPTION`n SO NAME YOUR SCRIPT FILE NOT *.AHK BUT *.DESCRIPTION`n FOR EXAMPLE p.Program Files CAPSLOCKp`n`n FOR EXAMPLE YOU HAVE A SCRIPT THAT OPENS FOLDER C:\PROGRAM FILES\`n SAVE IT AS "p.PROGRAM FILES CAPSLOCKp"`n YOU CAN NOW START IT NOW BY ENTERING p IN KEYWORD LAUNCHER (CAPSLOCK & TAB) OR BY PRESSING CAPSLOCK & P`n YOU CAN USE ALSO SCROLLLOCKp NUMLOCKp OR HOTKEYpf IN FILE NAME`n !!! NOTE HOTKEYpf WILL BE LAUNCHED BY PRESSING P & F AS A HOTKEY WHEN SPEEDHOTKEY IS ON (CAPSLOCK & ENTER)!!!`n`n`n !!!NOTE, IF YOU HAVE FILES WITH SAME NAME`n E.G. p.Program files and p.Programs, ONLY THE FIRST FILE WILL BE LOADED AND WILL EXECUTED!!!`n`n !!!NOTE, YOU NEED TO SELECT YOUR WORKING DIR, THIS IS THE FOLDER WHERE ALL YOUR SCRIPTS ARE`n THERE IS NO SUBFOLDER SUPPORT YET, SO ONLY FILES IN THAT FOLDER ARE LOADED!!!`n`n !!!ONLY FILES THAT CONTAIN ONLY CHARACTERS AND "_" IN NAME BEFORE . ARE LOADED (RegEx - "^\w+\.")!!! else if A_EventInfo = 2 { GuiControl, , Edit1, SETTINGS`n`n`tAutoStart - select ON | OFF ASK`n`tany script with autostart in file name will be autostarted`n`n`tWebBrowser - select your webbrowser here`n`n`tWorkingDir - select folder with your scripts, at the moment there is no subfolder suport`n`n`tInstant Script - enter lines that you always use in Script Manager`n`tselect menu Setting - Instant Script - Set Instant Script`n`tafter reload the menu will contain each of your lines as a menu`n`tyou can insert them 1 by 1 or all at once`n`n`tFilter can help you find your script - go menu Edit - Set Filter`n`n`tChange color of keyword launcher - goto menu settings set gui color } else if A_EventInfo = 3 { GuiControl, , Edit1, START KEYWORD LAUNCHER`t`tCAPSLOCK & TAB (OR QUICKLY PRESS AND RELEASE CTRL THEN SHIFT)`n`nFILE AND FOLDER FINDER`t`t`tCAPSLOCK & SHIFT`n`nSCRIPT MANAGEMENT`t`t`tCAPSLOCK & F5`n`nREPEAD COMMAND`t`t`tCAPSLOCK & F2 or CAPSLOCK & CTRL`n`nRESTART SCRIPT MANAGER`t`tCAPSLOCK & F12`n`nSPEEDHOTKEYS`t`t`t`tCAPSLOCK/SCROLLOCK/NUMLOCK & ENTER/BACKSPACE / CTRL & CAPSLOCK/ESCAPE`n`nSHOW/HIDE WINDOWS`t`t`tCAPSLOCK & F4(HIDE), CAPSLOCK & F3(UNHIDE)`n`nTERMINATE RUNNING SCRIPTS`t`tCTRL & PAUSE OR CAPSLOCK & PAUSE (WILL TERMINATE ALL)`n`nOPEN ENVIRONMENT VAR IN EXPLORER`tCTRL & ENTER`n`nWIN SPY`t`t`t`t`tCAPSLOCK & F1`n`nHELP`t`t`t`t`tCAPSLOCK & F9`n`nSHOW ALL HOTKEYS`t`t`tCAPSLOCK & F7 } else if A_EventInfo = 4 { GuiControl, , Edit1, SPEEDHOTKEYS:`n`n`t - TO TURN ON SPEEDHOTKEYS PRESS STRG & CAPSLOCK OR CAPSLOCK & ENTER`n`n`t- IF YOU ENTER HOTKEY** IN FILE NAME YOU CAN RUN A PROGRAM PRESSING KEY & KEY`n`t - FOR EXAMPLE HOTKEYas WILL START YOUR PROGRAM BY PRESSING A & S WHEN SPEEDHOTKEY IS ON`n `n`t- ONLY ALNUM[A-Z0-9] CHARACTERS ARE POSSIBLE, SO F5 & A WILL NOT WORK`n`n`t- FOR EXAMPLE FILE NAME IS p.Program Files HOTKEYpf.ahk(generally .ahk is not requiered)`n`t- TURN ON SPEEDHOTKEYS AND PRESS P & F AS A HOTKEY TO RUN THAT FILE } else if A_EventInfo = 5 { GuiControl, , Edit1, FILE/FOLDER STARTER`n`n START WITH - CAPSLOCK+SHIFT -`n`n - HERE YOU CAN ACCESS FILES AND FOLDERS VERY FAST.`n `n - FIRST TYPE DRIVE LETTER, e.g. c (:\ WILL BE ADDED AUTOMATICALLY)`n - TYPE THE FOLDER OR FILE NAME AND TAKE OVER WITH TAB.`n - WITH F12 YOU CAN CHANGE WHAT YOU ARE SEARCHING FOR(FILE/FOLDER) FOLDERS CAN BE FOUND MUCH FASTER`n - WITH F11 YOU CAN SEARCH TROUGH SUBFOLDERS`n - TO DELETE LAST LETTER/CHARACTER PRESS - LEFT - INSTEAD OF - BACKSPACE -(BACKSPACE DELETES UP TO \)`n - PRESSING KEY "DOWN" WILL SHOW NEXT HIT`n - PRESSING KEY "UP" WILL RESET AND SEARCH FROM START`n - USE * AS WILDCARD(FOR EXAMPLE *.exe) } else if A_EventInfo = 6 { GuiControl, , Edit1, WINDOW MANAGER`n`n - YOU CAN HIDE AND UNHIDE ANY WINDOWS WITH CAPSLOCK & F4 AND CAPSLOCK & F3`n - YOU CAN ALSO UNHIDE THESE WINDOWs WITH RIGHT MOUSECLICK ON %SCRIPTNAME_VAR% IN YOUR TRAY. } else if A_EventInfo = 7 { GuiControl, , Edit1, WinInfo Menu by Jon`n`nTO START, MOVE MOUSE to the WINDOW/CONTROL/POSITION AND PRESS CAPSLOCK & F6`n`nTO COPY A VALUE, NAVIGATE TO IT AND PRESS ENTER OR CLICK ON IT } else if A_EventInfo = 8 { GuiControl, , Edit1, empty } else if A_EventInfo = 9 { GuiControl, , Edit1, empty } else if A_EventInfo = 10 { GuiControl, , Edit1, empty } else if A_EventInfo = 11 { GuiControl, , Edit1, empty } } Return } ;End of Help Box ;Editors Menu section Create_Menu: ;TRAYMENU Menu, tray, NoStandard Menu, tray, add, &SCRIPT MANAGER`t`t(CAPSLOCK && F5), Script_Manager Menu, tray, add, &FILE EXPLORER`t`t(CAPSLOCK && SHIFT), fileexplorer Menu, tray, add, &PROCESS TERMINATOR`t`t(CTRL && PAUSE - CAPSLOCK && PAUSE TERMINATE ALL), Process_Terminator Menu, tray, add, &RELOAD`t`t(CAPSLOCK && F12), Reload_Script Menu, tray, add, &LIST HOTKEYS`t`t(CAPSLOCK && F7), List_Hotkeys Menu, tray, add Menu, tray, add, Exit, Exit_App Menu, tray, add Menu, Tray, Add, &Unhide All Hidden Windows, mwt_RestoreAll Menu, Tray, Add ; Another separator line to make the above more special. Menu, Tray, Default, &SCRIPT MANAGER`t`t(CAPSLOCK && F5) Menu, Tray, Tip, %Scriptname_A% ;Editor Menu Menu, File, Add, &New File`tCTRL && N, New_File Menu, File, Add, &Open File`tCTRL && O, Open_File Menu, File, Add, Open Se&l. Script`tENTER, Open_selected_file Menu, File, Add Menu, File, Add, &Save File`tCTRL && S, Save_File Menu, File, Add, Save File &As`tCTRL && F12, Save_File Menu, File, Add Menu, File, Add, Save and Close &File, Save_Close_File Menu, File, Add, &Close File`tCTRL && W, Close_File Menu, File, Add Menu, File, Add, Re&name File, EDIT_MENU Menu, File, Add, S&how Files List, EDIT_MENU Menu, File, Add, &Delete File, Delete_File Menu, File, Add Menu, File, Add, &Reload List, Reload_list Menu, File, Add Menu, File, Add, &Exit, 98GuiClose Menu, Edit, Add, &Undo`tCTRL && Z, EDIT_MENU Menu, Edit, Add, &Redo`tCTRL && Y, EDIT_MENU MEnu, Edit, Add MEnu, Edit, Add, &Copy`tCTRL && C, EDIT_MENU MEnu, Edit, Add, &Paste`tCTRL && V, EDIT_MENU MEnu, Edit, Add, Cu&t`tCTRL && X, EDIT_MENU MEnu, Edit, Add Menu, Edit, Add, &Find && Replace`tCTRL && F, EDIT_MENU Menu, Edit, Add, Find &Next`tCTRL && F3, EDIT_MENU Menu, Edit, Add Menu, Edit, Add, &Go To Line`tCTRL && G, EDIT_MENU Menu, Edit, Add, Menu, Edit, Add, &Select Script`tCTRL && TAB, EDIT_MENU Menu, Edit, Add Menu, Edit, Add, &Edit AutoHotkey.ini, EDIT_MENU Menu, Edit, Add Menu, Edit, Add, Ne&xt File`tCTRL && PgDn, EDIT_MENU Menu, Edit, Add, Pre&vious File`tCTRL && PgUp, EDIT_MENU Menu, Edit, Add Menu, Edit, Add, Set F&ilter, EDIT_MENU Menu, Format, Add, &Font, EDIT_MENU IniRead, Instant_script, %A_ScriptName%, CONFIG, setinstandusedscript, `;ENTER OFTEN USED SCRIPTLINES HERE Menu, InstantScript, Add, In&sert All, EDIT_MENU Menu, InstantScript, Add, Set &Instant Script (current file), EDIT_MENU Menu, InstantScript, Add StringReplace, Instant_script, Instant_script, ``n, `n, A StringSplit, Instant_script, Instant_script, `n Loop %Instant_script0% { instant_script_temp := Instant_script%A_Index% Menu, InstantScript, Add, %instant_script_temp%, EDIT_MENU } Menu, Settings, Add, In&stant Script, :InstantScript Menu, AutoStart, Add, &ON, EDIT_MENU Menu, AutoStart, Add, O&FF, EDIT_MENU Menu, AutoStart, Add, &ASK, EDIT_MENU IniRead, set_auto_start, %A_ScriptName%, CONFIG, setautostart, ASK If set_auto_start = On Menu, AutoStart, Check, &ON else if set_auto_start = Off Menu, AutoStart, Check, O&FF else if set_auto_start =ASK Menu, AutoStart, Check, &ASK Menu, Settings, Add, &AutoStart, :AutoStart Menu, WebBrowser, Add, &Internet Explorer, EDIT_MENU Menu, WebBrowser, Add, %webbrowserfile%, EDIT_MENU If webbrowserfile = %A_ProgramFiles%\Internet Explorer\iexplore.exe Menu, WebBrowser, Check, &Internet Explorer else Menu, Webbrowser, Check, %webbrowserfile% Menu, Settings, Add, &WebBrowser, :WebBrowser Menu, WorkingDir, Add, %script_path%`t&Click to change, EDIT_MENU Menu, Settings, Add, Working &Dir, :WorkingDir Menu, suggest, Add, 0, EDIT_MENU Menu, suggest, Add, 1, EDIT_MENU Menu, suggest, Add, 2, EDIT_MENU Menu, suggest, Add, 3, EDIT_MENU Menu, suggest, Add, 4, EDIT_MENU Menu, suggest, Add, 5, EDIT_MENU Menu, suggest, Add, 6, EDIT_MENU Menu, suggest, Add, 7, EDIT_MENU Menu, suggest, Add, 8, EDIT_MENU Menu, suggest, Add, 9, EDIT_MENU Menu, suggest, Add, 10, EDIT_MENU Menu, suggest, Add, 11, EDIT_MENU Menu, suggest, Add, 12, EDIT_MENU Menu, suggest, Check, %suggest_times% Menu, Settings, Add, S&UGGEST AND RUN, :suggest Menu, Commandsuggest, Add, &ALWAYS SHOW ON, EDIT_MENU Menu, Commandsuggest, Add, &ALWAYS SHOW OFF, EDIT_MENU Menu, Commandsuggest, Add If command_suggest_always = ON Menu, Commandsuggest, Check, &ALWAYS SHOW ON else Menu, Commandsuggest, Check, &ALWAYS SHOW OFF Menu, fromwhichletter, Add, 2, EDIT_MENU Menu, fromwhichletter, Add, 3, EDIT_MENU Menu, fromwhichletter, Add, 4, EDIT_MENU Menu, fromwhichletter, Add, 5, EDIT_MENU Menu, fromwhichletter, Check, %command_suggest_from% Menu, Commandsuggest, Add, &From which letter, :fromwhichletter Menu, Commandsuggest, Add Menu, CommandSuggestamount, Add, 0, EDIT_MENU Menu, CommandSuggestamount, Add, 1, EDIT_MENU Menu, CommandSuggestamount, Add, 2, EDIT_MENU Menu, CommandSuggestamount, Add, 3, EDIT_MENU Menu, CommandSuggestamount, Add, 4, EDIT_MENU Menu, CommandSuggestamount, Add, 5, EDIT_MENU Menu, CommandSuggestamount, Add, 6, EDIT_MENU Menu, CommandSuggestamount, Add, 7, EDIT_MENU Menu, CommandSuggestamount, Add, 8, EDIT_MENU Menu, CommandSuggestamount, Add, 9, EDIT_MENU Menu, commandSuggestamount, Check, %command_suggest_amount% Menu, CommandSuggest, Add, &How many to suggest, :CommandSuggestamount Menu, Settings, Add, &COMMAND SUGGESTION, :Commandsuggest If command_suggest = ON Menu, Settings, Check, &COMMAND SUGGEST Menu, Settings, Add, SET &KEYWORD LAUNCHER COLOR, EDIT_MENU Menu, Help, Add, About, EDIT_MENU Menu, Help, Add Menu, Help, Add, Help, EDIT_MENU Menu, SCRIPTMANAGER, Add, &File, :File Menu, SCRIPTMANAGER, Add, &Edit, :Edit Menu, SCRIPTMANAGER, ADD, F&ormat, :Format Menu, SCRIPTMANAGER, ADD, &Settings, :Settings Menu, SCRIPTMANAGER, Add, &Help, :Help Menu, UPDATEPROCESS, Add, UPDATE, Update_processes Menu, UPDATEPROCESS, Add, Terminate, Terminate Return ;ahk command suggest section Create_command_suggest: ;ahk commands for Command Suggest ahk_commands = |Abs|ACos|Asc|ASin|ATan|AutoTrim|BlockInput|Break|Ceil|Chr|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Cos|Critical|DetectHiddenText|DetectHiddenWindows|DllCall|Drive|DriveGet|DriveSpaceFree|Edit|Else|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|Exp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileExist|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|Floor|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|IL_Add|IL_Create|IL_Destroy|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|InStr|IsLabel|KeyHistory|KeyWait|ListHotkeys|ListLines|ListVars|Ln|Log|Loop|LV_Add|LV_Delete|LV_DeleteCol|LV_GetCount|LV_GetNext|LV_GetText|LV_Insert|LV_InsertCol|LV_Modify|LV_ModifyCol|LV_SetImageList|Menu|Mod|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|NumGet|NumPut|OnExit|OnMessage|OutputDebug|Pause|PixelGetColor|Pixelsearch|PixelWaitColor|PostMessage|Process|Progress|Random|RegDelete|RegExMatch|RegExReplace|RegisterCallback|RegRead|RegWrite|Reload|Return|Round|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapsLockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumLockState|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sin|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|Sqrt|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|StrLen|SubStr|Suspend|SysGet|Tan|Thread|ToolTip|Transform|TrayTip|TV_Add|TV_Delete|TV_Get|TV_GetChild|TV_GetCount|TV_GetNext|TV_GetParent|TV_GetPrev|TV_GetSelection|TV_GetText|TV_Modify|URLDownloadToFile|VarSetCapacity|WinActivate|WinActivateBottom|WinActive|WinClose|WinExist|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive| ;ahk commands help content for Command Suggest newhelp = Abs(Number).Returns the absolute value of Number. The return value is the same type as Number (integer or floating point)>< newhelp = %newhelp%IfNotInString, var, value.Specifies the command to perform if the comparison of a variable to a value evalutes to TRUE>< newhelp = %newhelp%SetTitleMatchMode, MatchMode OR SetTitleMatchMode, Fast|Slow.Sets the matching behavior of the WinTitle parameter in commands such as WinWait>< Loop %newhelp0% { StringSplit, helpnew_split, newhelp%A_Index%, . instr_komma := InStr(helpnew_split1, ",") instr_space := InStr(helpnew_split1, " ") instr_brak := InStr(helpnew_split1, "(") ;ToolTip % instr_komma "`n" instr_space "`n" instr_brak "`n" instr_dot, 0, 0 If (instr_komma + instr_space + instr_brak = 0) { out_put_var := helpnew_split1 } else if (instr_komma != 0 and ((instr_komma < instr_space) or instr_space = 0) and ((instr_brak > instr_komma) or (instr_brak = 0))) { out_put_var := SubStr(helpnew_split1, 1, InStr(helpnew_split1, ",")-1) } else if (instr_brak = 0 or ((instr_space < instr_brak) and instr_space != 0)) { out_put_var := SubStr(helpnew_split1, 1, InStr(helpnew_split1, " ")-1) } else { out_put_var := SubStr(helpnew_split1, 1, InStr(helpnew_split1, "(")-1) } command_suggest_%out_put_var% = %helpnew_split1% command_suggest_info_%out_put_var% = %helpnew_split2% VarSetCapacity(newhelp%A_Index%,0) } Return ;end of Command suggest section ;WinInfo Menu by Jon. This shows information fo window or control, Many thanks 1Include_WinInfoMenu: CAPSLOCK & F1:: MouseGetPos, MousePosX, MousePosY, CurrentWinID CoordMode, Mouse, Screen MouseGetPos, MousePosScreenX, MousePosScreenY, CurrentWinID, ControlName WinGetTitle, CurrentWin, ahk_ID %CurrentWinID% SetTitleMatchMode, Slow WinGetTitle, CurrentWinSlow, ahk_ID %CurrentWinID% SetTitleMatchMode, Fast WinGetClass, CurrentWinClass, ahk_ID %CurrentWinID% ;------------------------------------------------------ Menu, Title, add, %CurrentWin%, WinSub_Title ;Menu, Title, add, %CurrentWinSlow% (match=slow), WinSub_TitleSlow Menu, Title, add, ahk_Class %CurrentWinClass%, WinSub_Class Menu, Title, add, ahk_id %CurrentWinID%, WinSub_ID Menu, Main, add, &Window Title, :Title ;------------------------------------------------------ WinGetPos, CurrentWinX, CurrentWinY, CurrentWinW, CurrentWinH, %CurrentWin% Menu, WinPos, add, X: %CurrentWinX% %a_tab% Y: %CurrentWinY%, WinSub_XY Menu, WinPos, add, W: %CurrentWinW% %a_tab% H: %CurrentWinH% , WinSub_WH Menu, Main, add, Window &Position, :WinPos ;------------------------------------------------------ WinGetText, WinText, %CurrentWin% if WinText= Menu, Text, add, No Text Found, WinSub_Text StringSplit, WinTextShort, WinText, `n Loop, %WinTextShort0% { StringTrimLeft, NewLine, WinTextShort%a_index%, 0 if NewLine= continue if (strlen(NewLine) > 100) { StringLeft, NewLine, NewLine, 100 NewLine=%NewLine% ---8<--- } Menu, Text, add, %NewLine%, WinSub_Text if a_index>15 { Menu, Text, add, -------------8<-------------, WinSub_Text break } } Menu, Main, add, Window &Text, :Text Menu, Main, add ;------------------------------------------------------ loop, 5 { StatusBarGetText, Part, %a_index%, %CurrentWin% if Part <> { x=1 Menu, Status, add, %a_index%) %Part%, StatusSub } } if x <> 1 Menu, Status, add, No Text Found, Status Menu, Main, add, &Status Bar, :Status ;------------------------------------------------------ Menu, MousePos, add, Screen, MouseSub_ScreenXY Menu, MousePos, add, &X: %MousePosScreenX% %a_tab% Y: %MousePosScreenY%, MouseSub_ScreenXY Menu, MousePos, add Menu, MousePos, add, Window, MouseSub_WindowXY Menu, MousePos, add, X: %MousePosX% %a_tab% &Y: %MousePosY%, MouseSub_WindowXY Menu, Main, add, &Mouse Position, :MousePos ;------------------------------------------------------ ControlGetPos, ControlPosX, ControlPosY, ControlPosW, ControlPosH, %ControlName%, %CurrentWin% ControlGetText, ControlText, %ControlName%, %CurrentWin% if ControlText= Menu, ControlText, add, No Text Found, ControlSub_Text StringSplit, ControlTextShort, ControlText, `n Loop, %ControlTextShort0% { StringTrimLeft, NewLine, ControlTextShort%a_index%, 0 if NewLine= continue if (strlen(NewLine) > 100) { StringLeft, NewLine, NewLine, 100 NewLine=%NewLine% ---8<--- } Menu, ControlText, add, %NewLine%, ControlSub_Text if a_index=10 { Menu, ControlText, add, -------------8<-------------, ControlSub_Text break } } Menu, Control, add, %ControlName%, ControlSub_Name Menu, Control, add Menu, Control, add, X: %ControlPosX% %a_tab% Y: %ControlPosY%, ControlSub_XY Menu, Control, add, W: %ControlPosW% %a_tab% H: %ControlPosH%, ControlSub_WH Menu, Control, add Menu, Control, add, Text, :ControlText Menu, Main, add, &Control, :Control ;------------------------------------------------------ PixelGetColor, PixelRGB, MousePosX, MousePosY, RGB PixelGetColor, PixelBGR, MousePosX, MousePosY x=3 loop, 3 { StringMid, HEX%a_index%, PixelRGB, %x%, 2 x+=2 } Menu, Colour, add, &RGB %PixelRGB%, PixelSub_HEX Menu, Colour, add, &BGR %PixelBGR%, PixelBGRSub_HEX Menu, Colour, add, % "R: " HEXtoDEC(HEX1) " G: " HEXtoDEC(HEX2)" B: " HEXtoDEC(HEX3), PixelSub_DEC Menu, Main, add, Pi&xel Colour (RGB/BGR), :Colour ;------------------------------------------------------ Menu, Main, Show ;Clears Menus Menu, Main, DeleteAll Menu, Control, DeleteAll Menu, ControlText, DeleteAll Menu, MousePos, DeleteAll Menu, WinPos, DeleteAll Menu, Text, DeleteAll Menu, Title, DeleteAll Menu, Colour, DeleteAll Menu, Status, DeleteAll return ;------------------------------------------------------ WinSub_Title: Clipboard=%CurrentWin% return WinSub_TitleSlow: Clipboard=%CurrentWinSlow% return WinSub_Class: Clipboard=AHK_class %CurrentWinClass% return WinSub_ID: Clipboard=AHK_ID %CurrentWinID% return WinSub_XY: Clipboard=%CurrentWinX% `, %CurrentWinY% return WinSub_WH: Clipboard=%CurrentWinW% `, %CurrentWinH% return WinSub_Text: Clipboard=%WinText% return MouseSub_ScreenXY: Clipboard=%MousePosScreenX% `, %MousePosScreenY% return MouseSub_WindowXY: Clipboard=%MousePosX% `, %MousePosY% return ControlSub_Name: Clipboard=%ControlName% return ControlSub_XY: Clipboard=%ControlPosX% `, %ControlPosY% return ControlSub_WH: Clipboard=%ControlPosW% `, %ControlPosH% return ControlSub_Text: Clipboard=%ControlText% return PixelSub_HEX: Clipboard=%PixelRGB% return PixelBGRSub_HEX: Clipboard=%PixelBGR% return PixelSub_DEC: Clipboard:=HEXtoDEC(HEX1) " " HEXtoDEC(HEX2) " " HEXtoDEC(HEX3) return StatusSub: StringTrimLeft, StatusText, A_ThisMenuItem, 3 clipboard=%StatusText% Status: return ;------------------------------------------------------ ----------------------------------------- ;My Function to converts HEX to DEC HEXtoDEC(HEX) { StringUpper, HEX, HEX loop, % StrLen(HEX) { StringMid, Col, HEX, % (StrLen(HEX)+1)-a_index, 1 if Col is integer DEC1:=Col*16**(a_index-1) Else DEC1:=(Asc(Col)-55)*16**(a_index-1) DEC+=%DEC1% } return DEC } ;end of winspy ;Anchor by Titan Anchor(i, a = "", r = false) { static c, cs = 12, cx = 255, cl = 0, g, gs = 8, z = 0, k = 0xffff, gx = 1 If z = 0 VarSetCapacity(g, gs * 99, 0), VarSetCapacity(c, cs * cx, 0), z := true If a = { StringLeft, gn, i, 2 If gn contains : { StringTrimRight, gn, gn, 1 t = 2 } StringTrimLeft, i, i, t ? t : 3 If gn is not digit gn := gx } Else gn := A_Gui If i is not xdigit { GuiControlGet, t, Hwnd, %i% If ErrorLevel = 0 i := t Else ControlGet, i, Hwnd, , %i% } gb := (gn - 1) * gs Loop, %cx% If (NumGet(c, cb := cs * (A_Index - 1)) == i) { If a = { cf = 1 Break } Else gx := A_Gui d := NumGet(g, gb), gw := A_GuiWidth - (d >> 16 & k), gh := A_GuiHeight - (d & k), as := 1 , dx := NumGet(c, cb + 4, "Short"), dy := NumGet(c, cb + 6, "Short") , dw := NumGet(c, cb + 8, "Short"), dh := NumGet(c, cb + 10, "Short") Loop, Parse, a, xywh If A_Index > 1 av := SubStr(a, as, 1), as += 1 + StrLen(A_LoopField) , d%av% += (InStr("yh", av) ? gh : gw) * (A_LoopField + 0 ? A_LoopField : 1) DllCall("SetWindowPos", "UInt", i, "Int", 0, "Int", dx, "Int", dy, "Int", dw, "Int", dh, "Int", 4) If r != 0 DllCall("RedrawWindow", "UInt", i, "UInt", 0, "UInt", 0, "UInt", 0x0101) ; RDW_UPDATENOW | RDW_INVALIDATE Return } If cf != 1 cb := cl, cl += cs If (!NumGet(g, gb)) { Gui, %gn%:+LastFound WinGetPos, , , , gh VarSetCapacity(pwi, 68, 0), DllCall("GetWindowInfo", "UInt", WinExist(), "UInt", &pwi) , NumPut(((bx := NumGet(pwi, 48)) << 16 | by := gh - A_GuiHeight - NumGet(pwi, 52)), g, gb + 4) , NumPut(A_GuiWidth << 16 | A_GuiHeight, g, gb) } Else d := NumGet(g, gb + 4), bx := d >> 16, by := d & k ControlGetPos, dx, dy, dw, dh, , ahk_id %i% If cf = 1 { Gui, %gn%:+LastFound WinGetPos, , , gw, gh d := NumGet(g, gb), dw -= gw - bx * 2 - (d >> 16), dh -= gh - by - bx - (d & k) } NumPut(i, c, cb), NumPut(dx - bx, c, cb + 4, "Short"), NumPut(dy - by, c, cb + 6, "Short") , NumPut(dw, c, cb + 8, "Short"), NumPut(dh, c, cb + 10, "Short") Return, true } ;CmnDlg 4.1 and hiEdit functions by majkinetor, Many thanks to majkinetor CmnDlg_Color(ByRef pColor, hGui=0){ ;covert from rgb clr := ((pColor & 0xFF) << 16) + (pColor & 0xFF00) + ((pColor >> 16) & 0xFF) VarSetCapacity(sCHOOSECOLOR, 0x24, 0) VarSetCapacity(aChooseColor, 64, 0) NumPut(0x24, sCHOOSECOLOR, 0) ; DWORD lStructSize NumPut(hGui, sCHOOSECOLOR, 4) ; HWND hwndOwner (makes dialog "modal"). NumPut(clr, sCHOOSECOLOR, 12) ; clr.rgbResult NumPut(&aChooseColor,sCHOOSECOLOR, 16) ; COLORREF *lpCustColors NumPut(0x00000103, sCHOOSECOLOR, 20) ; Flag: CC_ANYCOLOR || CC_RGBINIT nRC := DllCall("comdlg32\ChooseColorA", str, sCHOOSECOLOR) ; Display the dialog. if (errorlevel <> 0) || (nRC = 0) return false clr := NumGet(sCHOOSECOLOR, 12) oldFormat := A_FormatInteger SetFormat, integer, hex ; Show RGB color extracted below in hex format. ;convert to rgb pColor := (clr & 0xff00) + ((clr & 0xff0000) >> 16) + ((clr & 0xff) << 16) StringTrimLeft, pColor, pColor, 2 loop, % 6-strlen(pColor) pColor=0%pColor% pColor=0x%pColor% SetFormat, integer, %oldFormat% return true } CmnDlg_Find( hGui, fun, flags="d", deff="") { global CmnDlg_Event, CmnDlg_Flags, CmnDlg_FindWhat, CmnDlg_ReplaceWith static FINDMSGSTRING = "commdlg_FindReplace" static FR_DOWN=1, FR_MATCHCASE=4, FR_WHOLEWORD=2, FR_HIDEMATCHCASE=0x8000, FR_HIDEWHOLEWORD=0x10000, FR_HIDEUPDOWN=0x4000 static buf, FR, len := 256 f := 0 f |= InStr(flags, "d") ? FR_DOWN : 0 f |= InStr(flags, "c") ? FR_MATCHCASE : 0 f |= InStr(flags, "w") ? FR_WHOLEWORD : 0 f |= InStr(flags, "-d") ? FR_HIDEUPDOWN : 0 f |= InStr(flags, "-w") ? FR_HIDEWHOLEWORD :0 f |= InStr(flags, "-c") ? FR_HIDEMATCHCASE :0 if FR = VarSetCapacity(FR, 40, 0), VarSetCapacity(buf, len) if deff != buf := deff NumPut( 40, FR, 0) ;size NumPut( hGui, FR, 4) ;hwndOwner NumPut( f, FR, 12) ;Flags NumPut( &buf, FR, 16) ;lpstrFindWhat NumPut( len, FR, 24) ;wFindWhatLen ;MsgBox % fun CmnDlg_callback(fun,"","","") OnMessage( DllCall("RegisterWindowMessage", "str", FINDMSGSTRING), "CmnDlg_callback" ) return DllCall("comdlg32\FindTextA", "str", FR) } CmnDlg_Font(ByRef pFace, ByRef pStyle, ByRef pColor, pEffects=true, hGui=0) { RegRead, LogPixels, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontDPI, LogPixels VarSetCapacity(SLogFont, 128, 0) pEffects := pEffects ? 0x100 : 0 ;set initial name DllCall("RtlMoveMemory", "uint", &SLogFont+28, "Uint", &pFace, "Uint", 32) ;convert from rgb clr := ((pColor & 0xFF) << 16) + (pColor & 0xFF00) + ((pColor >> 16) & 0xFF) ;set intial data if InStr(pStyle, "bold") NumPut(700, SLogFont, 16) if InStr(pStyle, "italic") NumPut(255, SLogFont, 20, 1 ) if InStr(pStyle, "underline") NumPut(1, SLogFont, 21, 1) if InStr(pStyle, "strikeout") NumPut(1, SLogFont, 22, 1) if RegExMatch( pStyle, "s[1-9][0-9]*", s){ StringTrimLeft, s, s, 1 s := -DllCall("MulDiv", "int", s, "int", LogPixels, "int", 72) NumPut(s, SLogFont, 0) ; set size } else NumPut(16, SLogFont, 0) ; set default size VarSetCapacity(SChooseFont, 60, 0) NumPut(60, SChooseFont, 0) ; DWORD lStructSize NumPut(hGui, SChooseFont, 4) ; HWND hwndOwner (makes dialog "modal"). NumPut(&SLogFont, SChooseFont, 12) ; LPLOGFONT lpLogFont NumPut(0x041 + pEffects, SChooseFont, 20) ; CF_EFFECTS = 0x100, CF_SCREENFONTS = 1, CF_INITTOLOGFONTSTRUCT = 0x40 NumPut(clr, SChooseFont, 24) ; rgbColors r := DllCall("comdlg32\ChooseFontA", "uint", &SChooseFont) ; Display the dialog. if !r return false ;font name VarSetCapacity(pFace, 32) DllCall("RtlMoveMemory", "str", pFace, "Uint", &SLogFont + 28, "Uint", 32) pStyle := "s" NumGet(SChooseFont, 16) // 10 ;color old := A_FormatInteger SetFormat, integer, hex ; Show RGB color extracted below in hex format. pColor := NumGet(SChooseFont, 24) SetFormat, integer, %old% ;styles pStyle = VarSetCapacity(s, 3) DllCall("RtlMoveMemory", "str", s, "Uint", &SLogFont + 20, "Uint", 3) if NumGet(SLogFont, 16) >= 700 pStyle .= "bold " if NumGet(SLogFont, 20, "UChar") pStyle .= "italic " if NumGet(SLogFont, 21, "UChar") pStyle .= "underline " if NumGet(SLogFont, 22, "UChar") pStyle .= "strikeout " s := NumGet(sLogFont, 0) pStyle .= "s" Abs(DllCall("MulDiv", "int", abs(s), "int", 72, "int", LogPixels)) ;convert to rgb oldFormat := A_FormatInteger SetFormat, integer, hex ; Show RGB color extracted below in hex format. pColor := (pColor & 0xff00) + ((pColor & 0xff0000) >> 16) + ((pColor & 0xff) << 16) StringTrimLeft, pColor, pColor, 2 loop, % 6-strlen(pColor) pColor=0%pColor% pColor=0x%pColor% SetFormat, integer, %oldFormat% return 1 } CmnDlg_Open( hGui=0, Title="", Filter="", defaultFilter="", Root="", defaultExt="", flags="FILEMUSTEXIST HIDEREADONLY" ) { static OFN_ALLOWMULTISELECT:=0x200, OFN_CREATEPROMPT:=0x2000, OFN_DONTADDTORECENT:=0x2000000, OFN_EXTENSIONDIFFERENT:=0x400, OFN_FILEMUSTEXIST:=0x1000, OFN_FORCESHOWHIDDEN:=0x10000000, OFN_HIDEREADONLY:=0x4, OFN_NOCHANGEDIR:=0x8, OFN_NODEREFERENCELINKS:=0x100000, OFN_NOVALIDATE:=0x100, OFN_OVERWRITEPROMPT:=0x2, OFN_PATHMUSTEXIST:=0x800, OFN_READONLY:=0x1, OFN_SHOWHELP:=0x10, OFN_NOREADONLYRETURN:=0x8000, OFN_NOTESTFILECREATE:=0x10000 IfEqual, Filter, ,SetEnv, Filter, All Files (*.*) SplitPath, Root, RootFile, RootDir hFlags := 0x80000 ;OFN_ENABLEXPLORER always set loop, parse, flags,%A_TAB%%A_SPACE%,%A_TAB%%A_SPACE% if A_LoopField != hFlags |= OFN_%A_LoopField% VarSetCapacity( FN, 0xffff ) VarSetCapacity( lpstrFilter, 2*StrLen(filter)) VarSetCapacity( OFN ,90, 0) if RootFile != DllCall("lstrcpyn", "uint", &FN, "uint", &RootFile, "int", StrLen(RootFile)+1) ; Contruct FilterText seperate by \0 delta := 0 ;Used by Loop as Offset loop, Parse, Filter, | { desc := A_LoopField, ext := SubStr(A_LoopField, InStr( A_LoopField,"(" )+1, -1) lenD := StrLen(A_LoopField)+1, lenE := StrLen(ext)+1 ;including /0 DllCall("lstrcpyn", "uint", &lpstrFilter + delta, "uint", &desc, "int", lenD) DllCall("lstrcpyn", "uint", &lpstrFilter + delta + lenD, "uint", &ext, "int", lenE) delta += lenD + lenE } NumPut(0, lpstrFilter, delta, "UChar" ) ; Double Zero Termination ; Contruct OPENFILENAME Structure NumPut( 76, OFN, 0, "UInt" ) ; Length of Structure NumPut( hGui, OFN, 4, "UInt" ) ; HWND NumPut( &lpstrFilter, OFN, 12, "UInt" ) ; Pointer to FilterStruc NumPut( 0, OFN, 16, "UInt" ) ; Pointer to CustomFilter NumPut( 0, OFN, 20, "UInt" ) ; MaxChars for CustomFilter NumPut( defaultFilter, OFN, 24, "UInt" ) ; DefaultFilter Pair NumPut( &FN, OFN, 28, "UInt" ) ; lpstrFile / InitialisationFileName NumPut( 0xffff, OFN, 32, "UInt" ) ; MaxFile / lpstrFile length NumPut( 0, OFN, 36, "UInt" ) ; lpstrFileTitle NumPut( 0, OFN, 40, "UInt" ) ; maxFileTitle NumPut( &RootDir, OFN, 44, "UInt" ) ; StartDir NumPut( &Title, OFN, 48, "UInt" ) ; DlgTitle NumPut( hFlags, OFN, 52, "UInt" ) ; Flags NumPut( &defaultExt, OFN, 60, "UInt" ) ; DefaultExt res := (*&hGui = 45) ? DllCall("comdlg32\GetSaveFileNameA", "Uint", &OFN ) : DllCall("comdlg32\GetOpenFileNameA", "Uint", &OFN ) IfEqual, res, 0, return adr := &FN, f := d := DllCall("MulDiv", "Int", adr, "Int",1, "Int",1, "str"), res := "" if StrLen(d) != 3 ;windows adds \ when in root of the drive and doesn't do that otherwise d.="\" if ms := InStr(flags, "ALLOWMULTISELECT") loop if f := DllCall("MulDiv", "Int", adr += StrLen(f)+1, "Int",1, "Int",1, "str") res .= d f "`n" else { IfEqual, A_Index, 1, SetEnv, res, %d% ;if user selects only 1 file with multiselect flag, windows ignores this flag.... break } return ms ? SubStr(res, 1, -1) : SubStr(d, 1, -1) } CmnDlg_Replace( hGui, fun, flags="", deff="", defr="") { static FINDMSGSTRING = "commdlg_FindReplace" static FR_MATCHCASE=4, FR_WHOLEWORD=2, FR_HIDEMATCHCASE=0x8000, FR_HIDEWHOLEWORD=0x10000, FR_HIDEUPDOWN=0x4000 static buf_s, buf_r, FR, len := 256 f := 0 f |= InStr(flags, "c") ? FR_MATCHCASE : 0 f |= InStr(flags, "w") ? FR_WHOLEWORD : 0 f |= InStr(flags, "-w") ? FR_HIDEWHOLEWORD :0 f |= InStr(flags, "-c") ? FR_HIDEMATCHCASE :0 if FR = VarSetCapacity(FR, 40, 0), VarSetCapacity(buf_s, len), VarSetCapacity(buf_r, len) if deff != buf_s := deff if defr != buf_r := defr NumPut( 40, FR, 0) ;size NumPut( hGui, FR, 4) ;hwndOwner NumPut( f, FR, 12) ;Flags NumPut( &buf_s, FR, 16) ;lpstrFindWhat NumPut( &buf_r, FR, 20) ;lpstrReplaceWith NumPut( len, FR, 24) ;wFindWhatLen NumPut( len, FR, 26) ;wReplaceWithLen CmnDlg_callback(fun,"","","") OnMessage( DllCall("RegisterWindowMessage", "str", FINDMSGSTRING), "CmnDlg_callback" ) return DllCall("comdlg32\ReplaceTextA", "str", FR) } CmnDlg_Save( hGui=0, Title="", Filter="", defaultFilter="", Root="", defaultExt="", flags="" ) { return CmnDlg_Open( hGui, Title, Filter, defaultFilter, Root, defaultExt, flags ) } ;=========================================== PRIVATE =============================================== CmnDlg_callback(wparam, lparam, msg, hwnd) { static FR_DIALOGTERM = 0x40, FR_DOWN=1, FR_MATCHCASE=4, FR_WHOLEWORD=2, FR_HIDEMATCHCASE=0x8000, FR_HIDEWHOLEWORD=0x10000, FR_HIDEUPDOWN=0x4000, FR_REPLACE=0x10, FR_REPLACEALL=0x20, FR_FINDNEXT=8 static fun global CmnDlg_FindWhat ifEqual, hwnd, ,return fun := wparam flags := NumGet(lparam+0, 12) if (flags & FR_DIALOGTERM) return %fun%("close", "", "", "") CmnDlg_Flags .= (Flags & FR_MATCHCASE) && !(Flags & FR_HIDEMATCHCASE)? "c" : CmnDlg_Flags .= (Flags & FR_WHOLEWORD) && !(Flags & FR_HIDEWHOLEWORD) ? "w" : CmnDlg_FindWhat := DllCall("MulDiv", "Int", NumGet(lparam+0, 16), "Int",1, "Int",1, "str") if (flags & FR_FINDNEXT) { CmnDlg_Flags .= (Flags & FR_DOWN) && !(Flags & FR_HIDEUPDOWN) ? "d" : return %fun%("find", CmnDlg_Flags, CmnDlg_FindWhat, "") } if (flags & FR_REPLACE) or (flags & FR_REPLACEALL) { CmnDlg_Event := (flags & FR_REPLACEALL) ? "replace_all" : "replace" CmnDlg_ReplaceWith := DllCall("MulDiv", "Int", NumGet(lparam+0, 20), "Int",1, "Int",1, "str") return %fun%(CmnDlg_Event, CmnDlg_Flags, CmnDlg_FindWhat, CmnDlg_ReplaceWith) } } ;hiEdit functions by majkinetor GoToLine() { global hEdit, line cnt := HE_GetLineCount(hEdit) InputBox, line, Go To Line, Enter line (1 - %cnt%), , 200, 120,,,,,%line% if ErrorLevel return if line > cnt line := cnt line_idx := HE_LineIndex(hEdit, line-1) HE_SetSel( hEdit, line_idx, line_idx) HE_ScrollCaret(hEdit ) } FindNext( hEdit ){ global CmnDlg_FindWhat if (CmnDlg_FindWhat = "") return OnFind("find",CmnDlg_Flags,CmnDlg_FindWhat,"") Return } OnFind(Event, Flags, FindWhat, ReplaceWith){ global StringReplace, Flags, Flags, d, StringReplace, Flags, Flags, c, MATCHCASE%A_SPACE% StringReplace, Flags, Flags, w, WHOLEWORD%A_SPACE% If (HE_GetSelText(hEdit) = FindWhat and event = "replace") HE_ReplaceSel(hEdit, ReplaceWith) If (Event = "replace_all") { pos_started_on := HE_GetSel(hEdit) HE_SetSel(hEdit, 0) Loop { res := HE_FindText(hEdit, FindWhat, HE_GetSel(hEdit), -1, Flags) HE_SetSel(hEdit, res, res + StrLen(FindWhat)) If (HE_GetSelText(hEdit) = FindWhat) { HE_ReplaceSel(hEdit, ReplaceWith) } else break } HE_SetSel(hEdit, pos_started_on, 0) } res := HE_FindText(hEdit, FindWhat, HE_GetSel(hEdit)+ (res!="")*1, -1, Flags) HE_SetSel(hEdit, res, res + StrLen(FindWhat)) HE_ScrollCaret(hEdit) Return } HE_Add(hwnd, x, y, w, h, style="HSCROLL VSCROLL", dllPath="HiEdit.dll"){ global HE_MODULEID static WS_CLIPCHILDREN=0x2000000, WS_VISIBLE=0x10000000, WS_CHILD=0x40000000 static HSCROLL=0x8 ,VSCROLL=0x10, TABBED=4, HILIGHT=0x20, TABBEDBTOP=0x1, TABBEDHRZSB=0x2 ,TABBEDBOTTOM=0x4, SINGLELINE=0x40, FILECHANGEALERT=0x80 hStyle := 0 loop, parse, style, %A_Tab%%A_Space% { IfEqual, A_LoopField, , continue hStyle |= %A_LOOPFIELD% } if !init { HE_MODULEID := 1020 DllCall("LoadLibrary", "str", dllPath) init := true } hCtrl := DllCall("CreateWindowEx" , "Uint", 0x200 ; WS_EX_CLIENTEDGE , "str", "HiEdit" ; ClassName , "str", szAppName ; WindowName , "Uint", WS_CLIPCHILDREN | WS_CHILD | WS_VISIBLE | hStyle , "int", x ; Left , "int", y ; Top , "int", w ; Width , "int", h ; Height , "Uint", hwnd ; hWndParent , "Uint", HE_MODULEID ; hMenu , "Uint", 0 ; hInstance , "Uint", 0) HE_SetTabsImageList(hCtrl) return hCtrl } HE_AutoIndent(hEdit, pState ) { static HEM_AUTOINDENT := 2042 ;wParam=0, lParam=fAutoIndent:TRUE/FALSE SendMessage, HEM_AUTOINDENT, 0, pState,, ahk_id %hEdit% return errorlevel } HE_CloseFile(hEdit, idx=-1){ static HEM_CLOSEFILE := 2026 ;wParam=0, SendMessage, HEM_CLOSEFILE, 0, idx,, ahk_id %hEdit% return errorlevel } HE_ConvertCase(hEdit, case="toggle") { static HEM_CONVERTCASE=2046 ;EQU WM_USER+1022 ;wParam=CC_UPPERCASE/CC_LOWERCASE/CC_TOGGLECASE,lParam = -1 :Returns TRUE if successful/FALSE otherwise static cc_upper=0, cc_lower=1, cc_toggle=2, cc_capitalize=3 SendMessage, HEM_CONVERTCASE, cc_%case%, -1,, ahk_id %hEdit% Return ErrorLevel } HE_FindText(hEdit, sText, cpMin=0, cpMax=-1, flags="") { static EM_FINDTEXT=1080,WHOLEWORD=2,MATCHCASE=4 ;WM_USER + 56 hFlags := 0 loop, parse, flags, %A_Tab%%A_Space%,%A_Space%%A_Tab% if (A_LoopField != "") hFlags |= %A_LOOPFIELD% VarSetCapacity(FT, 12) NumPut(cpMin, FT, 0) NumPut(cpMax, FT, 4) NumPut(&sText, FT, 8) SendMessage, EM_FINDTEXT, hFlags, &FT,, ahk_id %hEdit% Return ErrorLevel } HE_GetColors(hEdit){ static HEM_GETCOLORS := 2038 static names := "Text,Back,SelText,ActSelBack,InSelBack,LineNumber,SelBarBack,NonPrintableBack,Number" VarSetCapacity(COLORS, 48, 0) SendMessage,HEM_GETCOLORS,0,&COLORS,,ahk_id %hEdit% ifEqual,ErrorLevel,FAIL, return FAIL fmt := A_FormatInteger SetFormat, integer, hex Loop, Parse, names, `, res .= A_LoopField "=" NumGet(COLORS, 4*(A_Index-1)) "`n" SetFormat, integer, %fmt% return SubStr(res, 1, -1) } HE_GetCurrentFile(hEdit){ static HEM_GETCURRENTFILE := 2032 ;wParam=0, lParam = 0 SendMessage, HEM_GETCURRENTFILE, 0, 0,, ahk_id %hEdit% return errorlevel } HE_GetFileCount(hEdit){ static HEM_GETFILECOUNT := 2029 ;wParam=0, lParam=0 SendMessage, HEM_GETFILECOUNT, 0, 0,, ahk_id %hEdit% return errorlevel } HE_GetFileName(hEdit, idx=-1){ static HEM_GETFILENAME := 2030 ;wParam = lpszFileName, lParam = -1 for current file or dwFileIndex :Returns TRUE if successful/FALSE otherwise VarSetCapacity(fileName, 512) SendMessage, HEM_GETFILENAME, &fileName, idx,, ahk_id %hEdit% return fileName } HE_GetFirstVisibleLine(hEdit){ static EM_GETFIRSTVISIBLELINE=206 SendMessage, EM_GETFIRSTVISIBLELINE, 0, 0,, ahk_id %hEdit% Return ErrorLevel } HE_GetLine(hEdit, idx=-1){ static EM_GETLINE=196 ;The return value is the number of characters copied. The return value is zero if the line number specified by the line parameter is greater than the number of lines in the HiEdit control if (idx = -1) idx := HE_LineFromChar(hEdit, HE_LineIndex(hEdit)) len := HE_LineLength(hEdit, idx) VarSetCapacity(txt, len), NumPut(len, txt) SendMessage, EM_GETLINE, idx, &txt,, ahk_id %hEdit% if ErrorLevel = 0 return VarSetCapacity(txt, -1) Return SubStr(txt, 1, ErrorLevel) } HE_GetLineCount(hEdit){ static EM_GETLINECOUNT=186 SendMessage, EM_GETLINECOUNT, 0, 0,, ahk_id %hEdit% Return ErrorLevel } HE_GetRedoData(hEdit, level){ static HEM_GETREDODATA=2040 ;wParam=Undo level (1 based), lParam=lpUNDODATA :Returns type of undo (UNDONAMEID) static UID_0="UNKNOWN",UID_1="TYPING",UID_2="DELETE",UID_3="DRAGDROP",UID_4="CUT",UID_5="PASTE",UID_6="SETTEXT",UID_7="REPLACESEL",UID_8="CLEAR",UID_9="BACKSPACE",UID_10="INDENT",UID_11="OUTDENT",UID_12="CODEPAGE",UID_13="CASE" static size = 128 VarSetCapacity( RD, 8, 0), VarSetCapacity( buf, size ), NumPut(&buf, RD), NumPut(size, RD, 4) SendMessage, HEM_GETREDODATA, level, &RD,, ahk_id %hEdit% VarSetCapacity(buf, -1) Return % UID_%ErrorLevel% } HE_GetSel(hEdit, ByRef start_pos="@",ByRef end_pos="@"){ static EM_GETSEL=176 VarSetCapacity(s, 4), VarSetCapacity(e, 4) SendMessage, EM_GETSEL, &s, &e,, ahk_id %hEdit% s := NumGet(s), e := NumGet(e) if (start_pos != "@") start_pos := s if (end_pos != "@") end_pos := e Return s } HE_GetSelText(hEdit){ static EM_GETSELTEXT = 1086 ;Returns: the number of characters copied, not including the terminating null character. HE_GetSel(hEdit, s, e), VarSetCapacity(buf, e-s+2) SendMessage, EM_GETSELTEXT, 0, &buf,, ahk_id %hEdit% VarSetCapacity(buf, -1) Return buf } HE_GetTextLenght(hEdit) { static WM_GETTEXTLENGTH=14 SendMessage, WM_GETTEXTLENGTH, 0, 0,, ahk_id %hEdit% Return ErrorLevel } HE_GetTextRange(hEdit, min=0, max=-1){ static EM_GETTEXTRANGE=1099 ;Returns: The number of characters copied, not including the terminating null character. if (max=-1) max := HE_GetTextLenght(hEdit) VarSetCapacity(buf, max-min+2) VarSetCapacity(RNG, 12), NumPut(min, RNG), NumPut(max, RNG, 4), NumPut(&buf, RNG, 8) SendMessage, EM_GETTEXTRANGE, 0, &RNG,, ahk_id %hEdit% VarSetCapacity(buf, -1) Return buf } HE_GetUndoData(hEdit, level){ static HEM_GETUNDODATA=2039 ;wParam=Undo level (1 based), lParam=lpUNDODATA :Returns type of undo (UNDONAMEID) static UID_0="UNKNOWN",UID_1="TYPING",UID_2="DELETE",UID_3="DRAGDROP",UID_4="CUT",UID_5="PASTE",UID_6="SETTEXT",UID_7="REPLACESEL",UID_8="CLEAR",UID_9="BACKSPACE",UID_10="INDENT",UID_11="OUTDENT",UID_12="CODEPAGE",UID_13="CASE" static size = 128 VarSetCapacity( UD, 8, 0), VarSetCapacity( buf, size ), NumPut(&buf, UD), NumPut(size, UD, 4) SendMessage, HEM_GETUNDODATA, level, &UD,, ahk_id %hEdit% VarSetCapacity(buf, -1) Return % UID_%ErrorLevel% } HE_LineFromChar(hEdit, ich) { static EM_LINEFROMCHAR=201 SendMessage, EM_LINEFROMCHAR, ich, 0,, ahk_id %hEdit% Return ErrorLevel } HE_LineIndex(hedit, idx=-1) { static EM_LINEINDEX=187 SendMessage, EM_LINEINDEX, idx, 0,, ahk_id %hEdit% Return ErrorLevel } HE_LineLength(hEdit, idx=-1) { static EM_LINELENGTH=193 SendMessage, EM_LINELENGTH, He_LineIndex(hEdit, idx) , 0,, ahk_id %hEdit% Return ErrorLevel } HE_LineNumbersBar( hEdit, state="show", linw=40, selw=10 ) { static HEM_LINENUMBERSBAR := 2036 ;EQU WM_USER+1012 ;wParam=LNB_HIDE/LNB_SHOW/LNB_AUTOSIZE, lParam=HIWORD:Selection bar width , LOWWORD:Line numbers width static LNB_HIDE=0, LNB_SHOW=1, LNB_AUTOMAXSIZE=2, LNB_AUTOSIZE=4 if state is not Integer state := LNB_%state% SendMessage, HEM_LINENUMBERSBAR,state,selw<<16 | linw,,ahk_id %hEdit% return errorlevel } HE_NewFile(hEdit){ static HEM_NEWFILE := 2024 ;wParam=0, lParam=0 SendMessage, HEM_NEWFILE, 0, 0,, ahk_id %hEdit% return errorlevel } HE_OpenFile(hEdit, pFileName, flag=0){ static HEM_OPENFILE := 2025 ;wParam=0, lParam=lpszFileName Returns TRUE if successful/FALSE otherwise SendMessage, HEM_OPENFILE, flag, &pFileName,, ahk_id %hEdit% return errorlevel } HE_Redo(hEdit) { static EM_REDO := 1108 SendMessage, EM_REDO,,,, ahk_id %hEdit% return ErrorLevel } HE_ReloadFile(hEdit, idx=-1) { static HEM_RELOADFILE=2027 ;EQU WM_USER+1003 ;wParam=0, lParam = -1 for current file SendMessage, HEM_RELOADFILE, 0, idx,, ahk_id %hEdit% Return ErrorLevel } HE_ReplaceSel(hEdit, text=""){ static EM_REPLACESEL=194 SendMessage, EM_REPLACESEL, 0, &text,, ahk_id %hEdit% Return ErrorLevel } HE_SaveFile(hEdit, pFileName, idx=-1){ static HEM_SAVEFILE := 2028 ;wParam=lpszFileName, lParam = -1 for current file or dwFileIndex :Returns SendMessage, HEM_SAVEFILE, &pFileName, idx,, ahk_id %hEdit% return errorlevel } HE_ScrollCaret(hEdit){ static EM_SCROLLCARET=183 SendMessage, EM_SCROLLCARET, 0, 0,, ahk_id %hEdit% Return ErrorLevel } HE_SetColors(hEdit, colors, fRedraw=true){ static HEM_SETCOLORS := 2037 static names := "Text,Back,SelText,ActSelBack,InSelBack,LineNumber,SelBarBack,NonPrintableBack,Operator,Number,Comment,String" at := A_AutoTrim AutoTrim, on Loop, Parse, colors, `n, `n { name := SubStr(A_LoopField, 1, i:=InStr(A_LoopField, "=")-1), val := SubStr(A_LoopField, i+2) name = %name% val = %val% if name not in %names% return "Invalid color name: '" name "'" if val is not Integer return "Invalid color value: '" val "'" n%name% := val } AutoTrim, %at% VarSetCapacity(COLORS, 36, 0) NumPut(nText , COLORS, 0) ;NormalTextColor NumPut(nBack , COLORS, 4) ;EditorBkColor NumPut(nSelText , COLORS, 8) ;SelectionForeColor NumPut(nActSelBack , COLORS, 12) ;ActiveSelectionBkColor NumPut(nInSelBack , COLORS, 16) ;InactiveSelectionBkColor NumPut(nLineNumber , COLORS, 20) ;LineNumberColor NumPut(nSelBarBack , COLORS, 24) ;SelBarBkColor NumPut(nNonPrintableBack, COLORS, 28) ;NonPrintableBackColor NumPut(nNumber , COLORS, 32) ;NumberColor SendMessage,HEM_SETCOLORS, &COLORS, fRedraw,,ahk_id %hEdit% return ErrorLevel } HE_SetCurrentFile(hEdit, idx){ static HEM_SETCURRENTFILE := 2033 ;wParam=0, lParam = dwFileIndex SendMessage, HEM_SETCURRENTFILE, 0, idx,, ahk_id %hEdit% return errorlevel } HE_SetEvents(hEdit, func, e="selchange"){ local old, hmask static ENM_KEYEVENTS = 0x10000, ENM_MOUSEEVENTS = 0x20000, ENM_SCROLLEVENTS = 0x8, ENM_SELCHANGEEVENTS = 0x80000, ENM_CONTEXTMENUEVENTS=0x20 static EM_SETEVENTMASK = 1093, events="key,mouse,scroll,selchange,contextmenu" if !IsLabel(func) return "Err: label doesn't exist`n`n" func hmask := 0 loop, parse, e, %A_Tab%%A_Space% { IfEqual, A_LoopField, , continue if A_LoopField not in %events% return "Err: unknown event - '" A_LoopField "'" hmask |= ENM_%A_LOOPFIELD%EVENTS } SendMessage, EM_SETEVENTMASK, 0, hMask,, ahk_id %hEdit% old := OnMessage(0x4E, "HE_onNotify") if (old != "HE_onNotify") HE_oldNotify := RegisterCallback(old) hEdit += 0 HE_%hEdit%_func := func return "OK" } HE_onNotify(wparam, lparam, msg, hwnd) { local code, hw, idFrom, m, l, w static EN_TABMCLICK=0x1000, EN_FILECHANGE=0x1001, EN_SELCHANGE = 0x702, EN_MSGFILTER = 0x700 idFrom := NumGet(lparam+4) ; and its ID if (idFrom != HE_MODULEID) return HE_oldNotify ? DllCall(HE_oldNotify, "uint", wparam, "uint", lparam, "uint", msg, "uint", hwnd) : "" hw := NumGet(lparam+0) ;control sending the message - this HiEdit code := NumGet(lparam+8) ;- 4294967296 HE_HWND := hw HE_EVENT := HE_INFO := "" if (code = EN_TABMCLICK) { HE_EVENT := "tabmclick" GoSub % HE_%hw%_func return } if (code = EN_FILECHANGE) { HE_EVENT := "filechange", HE_INFO := NumGet(lparam+12) GoSub % HE_%hw%_func return } if (code = EN_SELCHANGE) { HE_EVENT := "selchange", m := NumGet(lparam+20, 0, "Short")=16, l := NumGet(lparam+30) && !m HE_INFO := "S" NumGet(lparam+12) " E" NumGet(lparam+16) " L" NumGet(lparam+22) (m ? " t" : "") (l ? " *" : "") If IsLabel(HE_%hw%_func) GoSub % HE_%hw%_func return } if (code=EN_MSGFILTER) { m := NumGet(lparam+12), w := NumGet(lparam+16), l := NumGet(lparam+20) if m between 0x201 AND 0x209 ;mouse messges, don't report WM_MOUSEMOVE=0x200 HE_EVENT := "mouse", HE_INFO := "x" l & 0xFFFF " y" (l >> 16) " v" w else if m = 0x102 ;WM_CHAR HE_EVENT := "key", HE_INFO := chr(w) else if m = 0x7B ; WM_CONTEXTMENU HE_EVENT := "contextmenu" else if m = 0x20A ;WM_MOUSEWHEEL HE_EVENT := "scroll" if HE_EVENT GoSub % HE_%hw%_func return } } HE_SetFont(hEdit, pFont="") { local height, weight, italic, underline, strikeout , nCharSet local hFont, LogPixels static WM_SETFONT := 0x30 italic := InStr(pFont, "italic") ? 1 : 0 underline := InStr(pFont, "underline") ? 1 : 0 strikeout := InStr(pFont, "strikeout") ? 1 : 0 weight := InStr(pFont, "bold") ? 700 : 400 RegExMatch(pFont, "(?<=[S|s])(\d{1,2})(?=[ ,])", height) if (height = "") height := 10 RegRead, LogPixels, HKEY_LOCAL_MACHINE, SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontDPI, LogPixels height := -DllCall("MulDiv", "int", Height, "int", LogPixels, "int", 72) RegExMatch(pFont, "(?<=,).+", fontFace) if (fontFace != "") fontFace := RegExReplace( fontFace, "(^\s*)|(\s*$)") ;trim else fontFace := "MS Sans Serif" hFont := DllCall("CreateFont", "int", height, "int", 0, "int", 0, "int", 0 ,"int", weight, "Uint", italic, "Uint", underline ,"uint", strikeOut, "Uint", nCharSet, "Uint", 0, "Uint", 0, "Uint", 0, "Uint", 0, "str", fontFace) SendMessage,WM_SETFONT,hFont,TRUE,,ahk_id %hEdit% return ErrorLevel } HE_SetKeywordFile( pFile ){ return DllCall("HiEdit.dll\SetKeywordFile", "str", pFile) } HE_SetSel(hEdit, nStart=0, nEnd=-1) { static EM_SETSEL=0x0B1 SendMessage, EM_SETSEL, nStart, nEnd,, ahk_id %hEdit% Return ErrorLevel } HE_SetTabWidth(hEdit, pWidth, pRedraw=true){ static HEM_SETTABWIDTH := 2041 ;wParam=nChars, lParam=fRedraw:TRUE/FALSE SendMessage, HEM_SETTABWIDTH, pWidth, pRedraw,, ahk_id %hEdit% return errorlevel } HE_SetTabsImageList(hEdit, pImg="") { static LR_LOADFROMFILE := 0x10 , LR_CREATEDIBSECTION := 0x2000 , HEM_SETTABSIMAGELIST := 2043 , toolbarBMP := "424de60000000000000076000000280000001c00000007000000010004000000000070000000000000000000000010000000000000000000000000008000008000000080800080000000800080008080000080808000c0c0c0000000ff0000ff000000ffff00ff000000ff00ff00ffff0000ffffff00fddddfdddddfdddfdddddfddddfd0000fdddffddddffdddffddddffdddfd0000fddfffdddfffdddfffdddfffddfd0000fdffffddffffdddffffddffffdfd0000fddfffdddfffdddfffdddfffddfd0000fdddffddddffdddffddddffdddfd0000fddddfdddddfdddfdddddfddddfd0000" if (pImg = "") { deleteFile := true pImg := "___he_bar.bmp" WriteFile(pImg, toolbarBMP) } hImlTabs := DllCall("comctl32.dll\ImageList_LoadImage", "uint", 0 , "str", pImg , "int", 7, "int", 4 , "uint", 0x0FF00FF , "uint", IMAGE_BITMAP , "uint", LR_CREATEDIBSECTION | LR_LOADFROMFILE ) if (deleteFile) FileDelete, %pImg% SendMessage,HEM_SETTABSIMAGELIST,0,hImlTabs,,ahk_id %hEdit% } HE_ShowFileList(hEdit, x=0, y=0){ static HEM_SHOWFILELIST := 2044 ;EQU WM_USER+1020 ;wParam=X pos, lParam=Y pos SendMessage, HEM_SHOWFILELIST, x, y,, ahk_id %hEdit% } HE_Undo(hEdit) { static WM_UNDO := 772 SendMessage, WM_UNDO,,,, ahk_id %hEdit% return ErrorLevel } WriteFile(file,data) { Handle := DllCall("CreateFile","str",file,"Uint",0x40000000 ,"Uint",0,"UInt",0,"UInt",4,"Uint",0,"UInt",0) Loop{ if strlen(data) = 0 break StringLeft, Hex, data, 2 StringTrimLeft, data, data, 2 Hex = 0x%Hex% DllCall("WriteFile","UInt", Handle,"UChar *", Hex ,"UInt",1,"UInt *",UnusedVariable,"UInt",0) } DllCall("CloseHandle", "Uint", Handle) return } ;End of Hiedit