2 AUTOHOTKEY scripts Topic is solved
-
- Posts: 15
- Joined: 25 May 2022, 09:47
2 AUTOHOTKEY scripts
Hi,
Im now at programming,im medical doctor by proffesion is't my hobby.
I want to be more productive,i want to change press tab to win + 1,win + 2 win + 3 to swith active windows.
The second script it to finde and replece multiple all phrases forexemple "OUN " Ośrodkowy układ nerwowy"
Both script should be cut off after pressing esc.
I'm working currently on windows 10.
Thanks for your help
Im now at programming,im medical doctor by proffesion is't my hobby.
I want to be more productive,i want to change press tab to win + 1,win + 2 win + 3 to swith active windows.
The second script it to finde and replece multiple all phrases forexemple "OUN " Ośrodkowy układ nerwowy"
Both script should be cut off after pressing esc.
I'm working currently on windows 10.
Thanks for your help
Re: 2 AUTOHOTKEY scripts
Welcome to this AutoHotkey forum!
The AHK documentation is a good starting point for explanations & examples, along with this forum. Best of luck.
More: Alt-Tab hotkeys • Hotstrings
The AHK documentation is a good starting point for explanations & examples, along with this forum. Best of luck.
Code: Select all
Tab::Send !{Tab}
::oun::Ośrodkowy układ nerwowy
-
- Posts: 15
- Joined: 25 May 2022, 09:47
Re: 2 AUTOHOTKEY scripts
Sorry,it is not working,a want to achive affect a windows key press 1 for a 1 window then windows key press 2 and so on with you script a see only a mess on my screen.
is running but a dont't know how to add varible to this and achive affect tab::send #{2}
For a second script you don't understand i got a text in a text file a want a program with find and replace mulityple variables.
Code: Select all
tab::send #{1}
For a second script you don't understand i got a text in a text file a want a program with find and replace mulityple variables.
Re: 2 AUTOHOTKEY scripts
Code: Select all
Tab::Send % "#" ++n := Mod(0 n, 3)
-
- Posts: 15
- Joined: 25 May 2022, 09:47
Re: 2 AUTOHOTKEY scripts
Code: Select all
FileRead, Contents, H:\Mój dysk\artykuły\kleszcze.txt
Loop
{
MyString := StrReplace(kleszcze, "OUN", "ośrodkowy układ nerwowy", Count)
if (Count = 0) ; No more replacements needed.
break
}
FileAppend,"OUN",H:\Mój dysk\artykuły\kleszcze1.txt
Re: 2 AUTOHOTKEY scripts
Code: Select all
infile = H:\Mój dysk\artykuły\kleszcze.txt
outfile = %A_ScriptDir%\kleszcze-out.txt
FileRead, text, %infile%
out := StrReplace(text, "oun", "ośrodkowy układ nerwowy")
FileAppend, %out%, %outfile%
Run, %outfile%
-
- Posts: 15
- Joined: 25 May 2022, 09:47
Re: 2 AUTOHOTKEY scripts
Thanks for you help,it is almost done but it can't insert polish chart "ś" and "ł" in output file "ox9crodkowy ukx53ad ". it should be "ośrodkowy układ"
How can i apply pollish chart into that string ? In a input file everthing is working corrtectly.
How can i apply pollish chart into that string ? In a input file everthing is working corrtectly.
-
- Posts: 15
- Joined: 25 May 2022, 09:47
Re: 2 AUTOHOTKEY scripts
Code: Select all
the_language :=languageCode_0415 := "Polish"_%A_Language% ; Get the name of the system's default language.
infile = H:\Mój dysk\artykuły\kleszcze.txt
outfile = %A_ScriptDir%\kleszcze-out.txt
FileRead, text, %infile%
out := StrReplace(text, "oun", "ośrodkowy układ nerwowy")
FileAppend, %out%, %outfile%
Run, %outfile%
Re: 2 AUTOHOTKEY scripts
Add file encoding.
Code: Select all
FileAppend, %out%, %outfile%, UTF-16
Re: 2 AUTOHOTKEY scripts
Post your revised script. Delete the output file so that you can test again. Save your script as UTF-8 with BOM signature.
-
- Posts: 15
- Joined: 25 May 2022, 09:47
Re: 2 AUTOHOTKEY scripts
Code: Select all
the_language :=languageCode_0415
infile = H:\Mój dysk\artykuły\sepsa.txt
outfile = %A_ScriptDir%\sepsa_out.txt
FileRead, text, %infile%
out := StrReplace(text, "OCŻ", "ośrodkowe ciśnienie żylne")
FileAppend, %out%, %outfile%,UTF-16
Run, %outfile%
Re: 2 AUTOHOTKEY scripts
The following worked here. Input file & script are UTF-8 with BOM signature.
Code: Select all
infile = H:\Mój dysk\artykuły\sepsa.txt
; infile = %A_ScriptDir%\sepsa.txt
outfile = %A_ScriptDir%\sepsa_out.txt
If !FileExist(infile) {
MsgBox, 48, Error, File not found. Aborting.`n`n%infile%
Return
}
FileRead, text, %infile%
out := StrReplace(text, "OCŻ", "ośrodkowe ciśnienie żylne")
FileRecycle, %outfile%
FileAppend, %out%, %outfile%, UTF-16
Run, %outfile%
- Attachments
-
- sepsa.txt
- Input file
- (7 Bytes) Downloaded 25 times
-
- Posts: 15
- Joined: 25 May 2022, 09:47
Re: 2 AUTOHOTKEY scripts
thanks for your advance,it is not working all i got is a blank note in notepad.
Re: 2 AUTOHOTKEY scripts
You can display contents of sepsa file within the script.
-
- Posts: 15
- Joined: 25 May 2022, 09:47
Re: 2 AUTOHOTKEY scripts
OK text,thank you If you wish please help me.
- Attachments
-
- sepsa_out.txt
- (2 Bytes) Downloaded 23 times
-
- sepsa.txt.txt
- (11.66 KiB) Downloaded 23 times
-
- skrypt.ahk
- (391 Bytes) Downloaded 23 times
Re: 2 AUTOHOTKEY scripts
The infile is not a directory. It is the full path to your source text file. Before you change the script, test the one that I posted.
-
- Posts: 15
- Joined: 25 May 2022, 09:47
Re: 2 AUTOHOTKEY scripts
Sorry, I don't understand what is the difference between path and directory? I should copy H:\Mój dysk\artykuły
Re: 2 AUTOHOTKEY scripts
Try my script first. You can see the path to the file there. A directory is a folder.
-
- Posts: 15
- Joined: 25 May 2022, 09:47
Re: 2 AUTOHOTKEY scripts Topic is solved
Code: Select all
the_language :=languageCode_0415
infile = D:\skrypty autohotkey\sepsa
outfile = %A_ScriptDir%\sepsa_out.txt
FileRead, text, %infile%
out := StrReplace(text, "OCŻ", "ośrodkowe ciśnienie żylne")
FileAppend, %out%, %outfile%,UTF-16
Run, %outfile%
outfile = %A_ScriptDir%\sepsa_out.txt
If !FileExist(infile) {
MsgBox, 48, Error, File not found. Aborting.`n`n%infile%
Return
}
Last edited by BoBo on 31 May 2022, 03:17, edited 2 times in total.
Reason: Added [code][/code]-tags. Please do this on your own within your following threads/postings. Thx.
Reason: Added [code][/code]-tags. Please do this on your own within your following threads/postings. Thx.