Search found 4777 matches

by jeeswg
08 Aug 2018, 12:18
Forum: Ask For Help
Topic: random from a list, possible?
Replies: 6
Views: 87

Re: random from a list, possible?

Here's some example code. ^j:: my_array := "1,2,3,4,5,6,a,b,c,d,e,f,g,k,l,v,w,x,y,z" uit := my_array Sort, uit, Random D, MsgBox, % "output: " uit MsgBox, % StrSplit(uit, ",")[1] MsgBox, % StrSplit(uit, ",").1 my_array2 := StrSplit(uit, ",") MsgBox, ...
by jeeswg
08 Aug 2018, 11:03
Forum: Offtopic
Topic: db files and sql files
Replies: 8
Views: 347

Re: db files and sql files

- I have solutions for my 2 problems. - just me's SQLite library (Class_SQLiteDB.ahk) plus sqlite3.dll is good for creating and maintaining db files (binary files), and it's possible to retrieve the text via SQL queries e.g. generate a tsv file (tab-separated values). - For the .sql file (phpMyAdmin...
by jeeswg
08 Aug 2018, 10:03
Forum: Ask For Help
Topic: #Include <LibName> v. auto-include Topic is solved
Replies: 4
Views: 110

#Include <LibName> v. auto-include Topic is solved

- tl;dr when you do an auto-include, where does it put the code - These 2 lines serve a similar purpose: #Include <MyPrefix_MyFunc> MyPrefix_MyFunc() - Assuming that the function 'MyPrefix_MyFunc' isn't already defined. Both check 3 'Lib' folders for scripts called 'MyPrefix_MyFunc.ahk', and...
by jeeswg
08 Aug 2018, 09:44
Forum: Ask For Help
Topic: show all open txt files
Replies: 7
Views: 103

Re: show all open txt files

Try this. Btw please be aware of the first/current file issue I mentioned earlier. #NoEnv #SingleInstance force y:: e := "" for Process in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process") { if !InStr(Process.CommandLine, ".txt") continue mfile :...
by jeeswg
08 Aug 2018, 08:42
Forum: Ask For Help
Topic: show all open txt files
Replies: 7
Views: 103

Re: show all open txt files

- You need to state with text editor you are using. The techniques will be different for each editor. - Btw the command line string will contain the *first* file opened (or no file), which is not necessarily the *current* file. - Here is some code for retrieving the path from Notepad: notepad get/se...
by jeeswg
08 Aug 2018, 08:23
Forum: Ask For Help
Topic: Adapt a script for windows 8.1 and 10
Replies: 13
Views: 143

Re: Adapt a script for windows 8.1 and 10

- This line may be a problem: ControlGetText, DesPath, Edit1, ahk_id %WinID% - The line does not work for me on Windows 7. Use MsgBox, % DesPath to check whether any text was retrieved. - Check for examples using ComObjCreate("Shell.Application").Windows and Document.Folder.Self.Path to ge...
by jeeswg
07 Aug 2018, 15:07
Forum: Ask For Help
Topic: How to use script2 to block script1's hotkeys when a specific window is active WITHOUT using IfWinActive
Replies: 7
Views: 92

Re: How to use script2 to block script1's hotkeys when a specific window is active WITHOUT using IfWinActive

- Are you aware that hotkeys are positional. So, perhaps you can use fall through. If you have an '#IfWinActive' hotkey, and no earlier hotkey was triggered, that hotkey is triggered. #IfWinActive, A q::MsgBox, % "A" #IfWinActive, B q::MsgBox, % "B" #IfWinActive, C q::MsgBox, % &...
by jeeswg
07 Aug 2018, 10:59
Forum: Ask For Help
Topic: Object Value Setting Topic is solved
Replies: 2
Views: 39

Re: Object Value Setting Topic is solved

- This is the normal behaviour, consistent with your expectations.

Code: [Select all]GeSHi © Codebox Plus

oldvalue := obj.key ;get
obj.key := newvalue ;set
- Perhaps you are using a RegExMatch object, which is read-only.
by jeeswg
07 Aug 2018, 10:34
Forum: Ask For Help
Topic: A_ScriptName without extension
Replies: 8
Views: 92

Re: A_ScriptName without extension

From:
jeeswg's RegEx tutorial (RegExMatch, RegExReplace) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=28031

Code: [Select all]GeSHi © Codebox Plus

;remove extension (name to name no extension)
MsgBox, % RegExReplace(vName, "\.[^.]*$")
by jeeswg
07 Aug 2018, 09:58
Forum: Ask For Help
Topic: Find zoom level of Internet Explorer Topic is solved
Replies: 2
Views: 35

Re: Find zoom level of Internet Explorer Topic is solved

Here are two links. Cheers. Internet Explorer get/set zoom/text size - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=5&t=26359&p=165674#p165674 jeeswg's Internet Explorer and HTML tutorial - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=7&t=31766
by jeeswg
06 Aug 2018, 15:50
Forum: Scripts and Functions
Topic: list Recent Items (My Recent Documents) (Start Menu)
Replies: 5
Views: 635

Re: list Recent Items (My Recent Documents) (Start Menu)

- Here are 2 different ways to get the files in recent order. One via the registry, one via a file loop. (Tested on Windows 7.) - The one disadvantage of the file loop is that sometimes some random old links persist in the folder. q:: ;get recent files in order (via the registry) ;CSIDL_RECENT := 8 ...
by jeeswg
06 Aug 2018, 15:30
Forum: Ask For Help
Topic: Check if variable has something
Replies: 11
Views: 172

Re: Check if variable has something

- I showed a two-liner that does nothing.
- I'm asking for a one-liner that does nothing. What's the best currently available option?
- A do nothing function can be useful for complicated if-else ladders.
by jeeswg
06 Aug 2018, 15:02
Forum: Ask For Help
Topic: Check if variable has something
Replies: 11
Views: 172

Re: Check if variable has something

- I too would like there to be an official 'do nothing' one-liner. - You can use two curly braces: if (foo != "") { } - Or Sleep 0: if (foo != "") Sleep, 0 - If there is something better than Sleep 0 I would like to know. - Alternatively, you might be interested in the 'continue'...
by jeeswg
06 Aug 2018, 14:58
Forum: Ask For Help
Topic: ahk_exe of notepad++ Topic is solved
Replies: 1
Views: 43

Re: ahk_exe of notepad++ Topic is solved

Try this: ControlSend, Scintilla1, % Clipboard, ahk_class Notepad++ In principle your script was correct, however, using the exe name doesn't always get you the main window, there can be multiple windows per exe. When I tried this, it returned a ToolTip window, not the main window. Cheers. q:: WinGe...
by jeeswg
06 Aug 2018, 14:55
Forum: Ask For Help
Topic: changes inside the txt file - a bit specific.
Replies: 5
Views: 67

Re: changes inside the txt file - a bit specific.

- Try this. Cheers. - I use 'Loop, Parse' to loop through each line, and InStr to find the 4th comma in each line. q:: ;insert '00' before 4th comma vText = ;continuation section ( AAMC,1,20180803,1555,62.25,62.25,62.25,62.25,100 AAU,1,20180803,0930,0.65,0.65,0.65,0.65,8681 ) vOutput := ""...
by jeeswg
06 Aug 2018, 11:54
Forum: Ask For Help
Topic: objects: check if a method/property exists
Replies: 13
Views: 200

Re: objects: check if a method/property exists

- What are you saying about the documentation? - Btw I read through all the objects pages this weekend, they're listed here: jeeswg's objects tutorial - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=7&t=29232 - Have you never had any problems trying to read/understand/interp...
by jeeswg
06 Aug 2018, 11:16
Forum: Bug Reports
Topic: if statement influences floating point number
Replies: 13
Views: 211

Re: if statement influences floating point number

- The 'if' line appears to have no effect on the variable. - What does appear to have an effect is how you store the variable in the array. - E.g. here I store the variable as a number and as a string in 2 different keys: oArray := [vNum, "" vNum] q:: vPath := A_Desktop "\z " A_N...
by jeeswg
06 Aug 2018, 10:29
Forum: Ask For Help
Topic: 64-bit Inconsistencies
Replies: 11
Views: 225

Re: 64-bit Inconsistencies

- @Helgef: What are you trying to say about the 2 rules? Those 2 rules are the keys to getting structs to work. - @Alguimist: It would probably be a good idea to state the structs for both of these: MSGBOXPARAMS and MSGBOXDATA structures. For MSGBOXDATA, to state what you have so far. Perhaps there'...
by jeeswg
05 Aug 2018, 18:19
Forum: Ask For Help
Topic: 64-bit Inconsistencies
Replies: 11
Views: 225

Re: 64-bit Inconsistencies

- You can use C++ to retrieve the sizes of named structs or structs with definitions (as x64/x32, Unicode/ANSI). - IIRC a struct's size should be the multiple of the largest item (size 1/2/4/8). And, an item should start at a multiple of its size (so 1/2/4/8). In this context, any structs within a s...
by jeeswg
05 Aug 2018, 12:16
Forum: Scripts and Functions
Topic: [v1] v2's CallbackCreate function for AHK v1.
Replies: 2
Views: 116

Re: [v1] v2's CallbackCreate function for AHK v1.

- Hello Helgef well done. :wave: :clap: - Btw I might include this, or a version of it, in the next update of 'AHK v2 functions for AHK v1', if that's OK. Is that OK? Cheers. commands as functions (AHK v2 functions for AHK v1) - AutoHotkey Community https://autohotkey.com/boards/viewtopic.php?f=37&a...

Go to advanced search