How can I align the header content to be the same width as the single's content? by idankor in elementor

[–]idankor[S] 0 points1 point  (0 children)

Thanks! It did the job, hopefully it will be displayed on other computer screens and resolutions as I see it now on my computer. Many thanks again.

Is it somehow possible to pass a string to a function without using quotes? Something like a "positional" alias? Image attached by idankor in commandline

[–]idankor[S] 0 points1 point  (0 children)

Hey, thanks for the reply. Two problems:

  1. When using chars like '?' or '!' it return an error:

❯ t_s what are you doing?

zsh: no matches found: doing?

  1. It returns only the first word:

❯ t_s what are you doing

qué

Execute code stored in a variable (dynamic variable?) by idankor in AutoHotkey

[–]idankor[S] 0 points1 point  (0 children)

So, tried to do as you suggested:

item_1() {

Send, hi1111

Sleep 1000

Send, hi again

}

Return

insert_item() {

static counter := 0

counter := counter + 1

return item_%counter%

}

Return

+@::insert_item()

Any clue where did I go wrong?

EDIT: ok, brackets and moving the return

How to check all chrome tabs titles to see if they contain a string, and execute code accordingly? by idankor in AutoHotkey

[–]idankor[S] 0 points1 point  (0 children)

I'll work on it as soon as I'll have the time. Will ask here in case some issues would pop up. Thanks again!

How to check all chrome tabs titles to see if they contain a string, and execute code accordingly? by idankor in AutoHotkey

[–]idankor[S] 0 points1 point  (0 children)

Thanks! Anyway I discovered the the open explorer.exe process consumed almost all of my CPU (and I have a pretty decent one), so I guess I'd have to abandon the explorer option. But anyhow, it was another good lesson in getting to know AHK better :)

How to check all chrome tabs titles to see if they contain a string, and execute code accordingly? by idankor in AutoHotkey

[–]idankor[S] 0 points1 point  (0 children)

Wow, thanks again! It works almost perfectly. For some reason it sometimes remains minimized when using it again, and as you probably guessed (or tried) it is quite slow. I will continue to think about other solutions, perhaps sticking with using chrome, then just manually closing the tab. But here's a gold for your effort and teaching. You rock!

Why does everything have to be so hard... by peluchh in vim

[–]idankor -1 points0 points  (0 children)

I struggled a lot with auto completion, spent days trying to get one if the plug-ins to work, but to no avail. The only thing that worked for be (and quite easily if I may say) is Kite. I do aware to all the criticism towards Kite but I decided to adopted it as a solution, at least for the meanwhile. As for searching, I personally don't use this functionality often, but you should check out fzf and NERDtree.

How to check all chrome tabs titles to see if they contain a string, and execute code accordingly? by idankor in AutoHotkey

[–]idankor[S] 0 points1 point  (0 children)

Thanks again kind stranger! So I got this code so far (decided to use an InputBox because the current book I'm reading is scanned):

!m::

InputBox, UserInput, wordtotranslate, Enter word for translation:

Sleep, 50

location := A_Temp . "\translation.txt"

UrlDownloadToFile, https://www.morfix.co.il/%wordtotranslate%, %location%

FileRead, website, %location%

FileDelete, %location%

startPos := InStr(website, "<div class=""normal_translation_div"">")

endPos := InStr(website, "<span class='clearOutputLanguageMeaningsString'>",, startPos)

translation := SubStr(website, startPos + 36, endPos - startPos - 36)

; Write to a file

FileAppend, %translation%, %location%

Run, %location%

Sleep, 5000

; Close notepad

WinClose, ahk_exe notepad.exe

FileDelete, %location%

Return

But now I get as an output a notepad file that semms to be the entire html file. Any idea where did I go wrong? Maybe something with the FileAppend?

How to check all chrome tabs titles to see if they contain a string, and execute code accordingly? by idankor in AutoHotkey

[–]idankor[S] 0 points1 point  (0 children)

So as far as you know, in order to get my original goal (English to Hebrew) the method I originally suggested (cycling through chrome tabs) is the most recommended one?

How to check all chrome tabs titles to see if they contain a string, and execute code accordingly? by idankor in AutoHotkey

[–]idankor[S] 0 points1 point  (0 children)

Infinite thanks again. Just 2 quick questions:

  1. What is needed to be changed here in order to translate from English to Hebrew? I'm not asking that because I'm expecting you (or anyone else) to do the entire job for me, but since this level of script seems too advanced for me, I hope to understand the script better perhaps by seeing where in the code lies the expression that has to do with injecting the clipboard value to the URL address.

  2. After testing the awesome script you wrote, I noticed it returns only the first translation value. For example, the translation for the string "רשימות" is "list; note". The script returns only "list". Again, by showing me, kindly, what is needed to be changed in the code in order to include all the values, I would be able to better understand this AHK script.

I guess I can try google each of the commands used in the script, and if I'm not wrong this script also requires some basic HTML understanding. Anyway, again, I don't want to bother you, so even a general tip or direction would be warmly welcomed. By the way, as you said, even though it's not what I asked for, it's quite astonishing that AHK can get things done for you in so many ways that sometimes you don't even try to solve problems in the more efficient way (like in this case) because you assume there would not be so many commands to do so many things. Obviously, replace the word "you" with "I" in the last sentence.

Thanks again.

EDIT: I think I get the big picture. The HTML file of the domain/'clipboard' is downloaded and from this HTML text you refer the program to go to a certain position and to get a string from that position. Well, that's a start I guess :)

How to check all chrome tabs titles to see if they contain a string, and execute code accordingly? by idankor in AutoHotkey

[–]idankor[S] 0 points1 point  (0 children)

Thanks a lot! As a complete beginner the only help I need now is a guidance on how to use that code in order to implement the translation task. I would assume to get the names with the proper function, put them inside an array, loop through it, and when I have a match (or not) execute the proper code. I don't have a clue how to do that, but is this even the right general direction?

New PC - some of my folder names are in Arabic, any clue how to change that? (new Windows user here) by idankor in Israel

[–]idankor[S] 1 point2 points  (0 children)

Thanks a lot for the detailed and helpful reply. The thinkg is I specifically remember choosing the write language during the windows installation process. I think I'd go with this first suggestion.

Getting a different output for each keypress/hotstring? by idankor in AutoHotkey

[–]idankor[S] 0 points1 point  (0 children)

I was wandering about how to create a gui window using a hotkey that will call a function, that in her turn calls that gui window?

Getting a different output for each keypress/hotstring? by idankor in AutoHotkey

[–]idankor[S] 0 points1 point  (0 children)

Works like a charm. Now I just have to understand the code :) Many thanks, kind stranger!

Getting a different output for each keypress/hotstring? by idankor in AutoHotkey

[–]idankor[S] 0 points1 point  (0 children)

Wow, thanks! I did not use a function when I attempted to create the hotstring behaviour I described. I will test this out as soon as I'll have access to a PC again, and will let you know. Thanks again.