Search found 403 matches

by SirRFI
23 Jun 2018, 18:21
Forum: Ask For Help
Topic: setting a value in an associative array of associative arrays using variables Topic is solved
Replies: 10
Views: 193

Re: setting a value in an associative array of associative arrays using variables Topic is solved

Jack := {profession: "teacher" , height: "tall" , country: "USA" , city: "New York"} Paul := {profession: "cook" , height: "short" , country: "UK" , city: "London"} Bill := {profession: "designer" , height: &q...
by SirRFI
21 Jun 2018, 14:42
Forum: Ask For Help
Topic: How to execute commands
Replies: 2
Views: 123

Re: How to execute commands

Apparently the recoder uses it's own functions, since OriginWin doesn't exist in in-built library and Click works differently. Without the library with these functions - they won't work.
Other than that - look up hotkeys.
by SirRFI
14 Jun 2018, 15:17
Forum: Ask For Help
Topic: How do YOU start most of your AHK scripts?
Replies: 7
Views: 220

Re: How do YOU start most of your AHK scripts?

I don't entirely understand your question, but you can create separate files and include them into a main one. If you need hotkeys working under certain condition, such as for certain program currently active, you can use #if WinActive() or so. I always start scripts with a hotkey to reload ...
by SirRFI
10 Jun 2018, 12:06
Forum: Ask For Help
Topic: RegExReplace optimisation Topic is solved
Replies: 6
Views: 196

Re: RegExReplace optimisation Topic is solved

Untested in AHK though, but should behave the same.
by SirRFI
10 Jun 2018, 09:30
Forum: Ask For Help
Topic: -topic moved-
Replies: 2
Views: 83

Re: Search for pixel x,y, add +20 to x - another attempt

wolf_II wrote:Repair: try swapping first line with second line. untested.
Reason: no point of calculating MyVar without FIRST knowing a value for Px.

↑ This. At the moment you calculate it, it's 0 + 20, because Px is unknown at the time.
Alternatively make a function.
by SirRFI
10 Jun 2018, 09:24
Forum: Ask For Help
Topic: RegExReplace optimisation Topic is solved
Replies: 6
Views: 196

Re: RegExReplace optimisation Topic is solved

How about this?:
^[_]*([^|\n\r]+)(\|[^\.\n]+\|)?([^|\n\r]+)?$
https://regex101.com/r/GQjPg0/5
by SirRFI
10 Jun 2018, 05:14
Forum: Ask For Help
Topic: RegExReplace optimisation Topic is solved
Replies: 6
Views: 196

Re: RegExReplace optimisation Topic is solved

Provide more details. Do you want only first word to be displayed, part of the sentence (up to X symbols) or entire sentence till | symbol?
by SirRFI
10 Jun 2018, 05:10
Forum: Ask For Help
Topic: Compile with password error
Replies: 1
Views: 62

Re: Compile with password error

AHK uses UTF-8 with BOM, which is appended at the beginning of the file. Perhaps it's it, although as I recall BOM is represented differently, unless the password thing does that. How do you compile with password anyway? There wasn't such option last I checked, but can't recheck that at this moment.
by SirRFI
05 Jun 2018, 14:54
Forum: Ask For Help
Topic: How to exit AHK Script after Programm ends Topic is solved
Replies: 4
Views: 109

Re: How to exit AHK Script after Programm ends Topic is solved

ExitApp closes AHK. The thing is - how to determine Excel has closed? I would suggest SetTimer every minute or something to see if WinExist, and if it doesn't - see first sentence.
by SirRFI
05 Jun 2018, 14:32
Forum: Ask For Help
Topic: Passing a number through as a literal string Topic is solved
Replies: 12
Views: 287

Re: Passing a number through as a literal string Topic is solved

Ps. There are plenty of things you can do to the current code to make it shorter and easier to manage, assuming you are interested. Yes please what would you do differently? I wanted to say plenty, but actually there just few things, since most of the code is somewhat repeated and can be shortened....
by SirRFI
03 Jun 2018, 17:32
Forum: Ask For Help
Topic: Passing a number through as a literal string Topic is solved
Replies: 12
Views: 287

Re: Passing a number through as a literal string Topic is solved

f it's checking to see if the file exists then shouldn't it be if (FileExist(path file_name) == "") ? See FileExist - quote from the docs: This function returns the attribute string of the first matching file or folder ... If the file has no attributes (rare), "X"...
by SirRFI
03 Jun 2018, 14:31
Forum: Ask For Help
Topic: Passing a number through as a literal string Topic is solved
Replies: 12
Views: 287

Re: Passing a number through as a literal string Topic is solved

I don't really know what is going on here at all. What is lookForFiles? What is path (is this a reference to my variable?) lookForFiles is how I called this custom function . path and files is how I called function's arguments (variables that exist only within the function, and contain contents tha...
by SirRFI
03 Jun 2018, 10:53
Forum: Ask For Help
Topic: Passing a number through as a literal string Topic is solved
Replies: 12
Views: 287

Re: Passing a number through as a literal string Topic is solved

The MsgBox line was only for presentation of how this function works. You don't need it in your actual script. If you look at it - it checks if file or folder iBetYouDontHaveSuchFileOrFolder exists in C:\Windows , if it doesn't - tries next file in array, which is notepad.exe . This file actually ex...
by SirRFI
03 Jun 2018, 10:36
Forum: Ask For Help
Topic: Need help with reading INI file into array variables.
Replies: 16
Views: 494

Re: Need help with reading INI file into array variables.

Does it have to be ini? JSON or YAML are arrays/objects by default, so there's no extra struggle. Additionally, plenty other languages support JSON, allowing you to transfer data between programs.
by SirRFI
03 Jun 2018, 09:28
Forum: Ask For Help
Topic: Send data to Python script (Messaging Queue) Topic is solved
Replies: 1
Views: 66

Re: Send data to Python script (Messaging Queue) Topic is solved

If you run python script from AHK, perhaps you can pass the numbers as parameters/arguments. If you don't - maybe make both scripts wait for a JSON, and if they were saved to file - delete after reading.
Might be not the best solution, but surely an easy one.
by SirRFI
03 Jun 2018, 08:34
Forum: Ask For Help
Topic: Passing a number through as a literal string Topic is solved
Replies: 12
Views: 287

Re: Passing a number through as a literal string Topic is solved

I see. In that case you may try following: demo: MsgBox % lookForFiles("C:\Windows\", ["iBetYouDontHaveSuchFileOrFolder", "notepad.exe"]) lookForFiles(path, files) ; path must be string, files must be array { if (!IsObject(files)) throw Exception("Provided file lis...
by SirRFI
03 Jun 2018, 07:01
Forum: Ask For Help
Topic: Looping, scrolling or browsing through associative arrays Topic is solved
Replies: 9
Views: 197

Re: Looping, scrolling or browsing through associative arrays Topic is solved

But the value end up blank. Each key in IDIndex also has its own subarray documenting among other things an executeable file. I can currently learn the Executeable associated with the Key by using IDIndex[69883].Executeable Do you know how complete the above piece of code so that "value" ...
by SirRFI
03 Jun 2018, 06:36
Forum: Ask For Help
Topic: Passing a number through as a literal string Topic is solved
Replies: 12
Views: 287

Re: Passing a number through as a literal string Topic is solved

One thing that I am sure of is that the script stores a value of either '1' or '0' for the file variable every time. This is likely because you made logical expression in the assign line - more precisely the OR s. If either of the strings are considered "true" (for what ever reason), it r...
by SirRFI
03 Jun 2018, 06:18
Forum: Ask For Help
Topic: I don't know the difference between `r and `n
Replies: 9
Views: 282

Re: I don't know the difference between `r and `n

\n and \r are different characters in ASCII, used for representing new line in text. Linux's and general standard is just n (line feed) character for new line, but some/most Microsoft Windows' programs (at least these old ones) use \r\n instead (where r - carriage return). They are presented this w...
by SirRFI
03 Jun 2018, 06:08
Forum: Ask For Help
Topic: Looping, scrolling or browsing through associative arrays Topic is solved
Replies: 9
Views: 197

Re: Looping, scrolling or browsing through associative arrays Topic is solved

Difference between indexed-array ( [] ) and associated-array ( {} ) is that the first one sets integer key automatically to reflect "position", while in the second key can be string and has to be set manually. Since the keys are no longer numbers, you can't simply use Loop % array.length&#...

Go to advanced search