Velká písmena s diakritikou

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
otto_stepan
Posts: 7
Joined: 19 Feb 2019, 05:10

Velká písmena s diakritikou

19 Feb 2019, 05:26

Začínám a už mám problém.
Použiji příkaz send s textem (příklad): "Šel jsem k šéfovi" a vypíše se mi "šel jsem k šéfovi". tedy malé š.
Jak to donutit aby to psalo VELKÉ Š???
Zatím jsem to vyřešil pomocí clipboard = ale to není ono... Leda... Existuje příkaz pro Paste který bych dal na konec textu???
Dík za pomoc.
garry
Posts: 3770
Joined: 22 Dec 2013, 12:50

Re: Velká písmena s diakritikou

19 Feb 2019, 06:19

just a short example , use CTRL+C , send copied text to Notepad (ESC = quit script )

Code: Select all

pr=notepad.exe
sc=ahk_exe notepad.exe
$^c::
sendinput, ^c         ;- copy marked text
clipwait,2
IfWinNotExist,%sc%
 {
 Run, %pr%,,,pid1
 WinWait,%sc%
 }
IfWinNotActive ,%sc%,,WinActivate,%sc%
    WinWaitActive,%sc%
send,^v                      ;- send to notepad
sleep,200
sendinput,{Enter}
clipboard=
return
esc::exitapp    ; quit this script with escape
see stringupper for big characters

Code: Select all

transform,s,chr,32
c1="miroslav zikmund"              ;- replace to Miroslav Zikmund
StringReplace,c1,c1,`",, All
Loop,parse,c1,%s%
  {
  x:=a_loopfield
  if x in da,do,de,van
    {
    e .= x . "_"
    continue
    }
  StringUpper,x,x,T
  e .= x . "_"
  }
stringtrimright,c1,e,1
run, https://en.wikipedia.org/wiki/%c1%
return
otto_stepan
Posts: 7
Joined: 19 Feb 2019, 05:10

Re: Velká písmena s diakritikou

19 Feb 2019, 06:42

Tohle:
^!u::clipboard=Ústí nad Orlicí
funguje ale musím ctrl-v v okně formuláře. Chtěl bych se toho kliknutí zbavit.

Tohle:
^+u::send, Ústí nad Orlicí
vypíše: ústí nad Orlicí s malým ú

Prostě a jednoduše: send AHK mění VŠECHNA VELKÁ PÍSMENA S DIAKRITIKOU na malá s diakritikou.
Dík za pomoc
garry
Posts: 3770
Joined: 22 Dec 2013, 12:50

Re: Velká písmena s diakritikou

19 Feb 2019, 08:27

try to ask english for better help
maybe see forums below in different languages : german , spanish , russian, french, portuguese, chinese
or use translator , example
https://translate.google.de/#cs|en

Code: Select all

/*
Ústí nad Orlicí >
ústí nad Orlicí   ( s malým ú )
*/

a=Ústí nad Orlicí
stringmid,b,a,1,1
stringtrimleft,d,a,1
StringLower,c,b
x=%c%%d%
msgbox,%x% 
return
otto_stepan
Posts: 7
Joined: 19 Feb 2019, 05:10

Re: Great letters with diacritics

19 Feb 2019, 08:52

This command:
^+u:: send, Ústí nad Orlicí
lists: "ústí nad Orlici" with small letter ú!!!!

Simply: AHK command send changes ALL LARGE CHAR WITH DIAKRITIS to small char.
Specific Czech problem :crazy:
Thank you for your help
Oss
garry
Posts: 3770
Joined: 22 Dec 2013, 12:50

Re: Velká písmena s diakritikou

19 Feb 2019, 09:15

sorry , I was wrong , when send you get small character > ú
try this , send to notepad with key F4
( maybe use 'FileEncoding, UTF-8' or save script (notepad) as UTF-8 )

Code: Select all

a=Ústí nad Orlicí
b=Štramberk or Plzeň

pr=notepad.exe
sc=ahk_exe notepad.exe

$F4::
IfWinNotExist,%sc%
 {
 Run, %pr%,,,pid1
 WinWait,%sc%
 }
IfWinNotActive ,%sc%,,WinActivate,%sc%
    WinWaitActive,%sc%
sendinput,%a%`n%b%`n
return
otto_stepan
Posts: 7
Joined: 19 Feb 2019, 05:10

Re: Velká písmena s diakritikou

19 Feb 2019, 10:37

OOPS! Some big diakritic chars are not transforned to small!
Try:
a=normal: áčďéěíňóřšťúůýž
b=SHIFT: ÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ

pr=notepad.exe
sc=ahk_exe notepad.exe

$F4::
IfWinNotExist,%sc%
{
Run, %pr%,,,pid1
WinWait,%sc%
}
IfWinNotActive ,%sc%,,WinActivate,%sc%
WinWaitActive,%sc%
sendinput,%a%`n%b%`n
return
garry
Posts: 3770
Joined: 22 Dec 2013, 12:50

Re: Velká písmena s diakritikou

19 Feb 2019, 13:02

try this, I see a small difference with " d " when look in notepad
( I copied from charmap > ď , seems correct , it correspond to Ď )

Code: Select all

FileEncoding, UTF-8
a=normal: áčďéěíňóřšťúůýž
b=SHIFT: ÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ

pr=notepad.exe
sc=ahk_exe notepad.exe

$F4::
IfWinNotExist,%sc%
{
Run, %pr%,,,pid1
WinWait,%sc%
}
IfWinNotActive ,%sc%,,WinActivate,%sc%
WinWaitActive,%sc%
;sendraw,%a%`n%b%`n
;sendinput, % "{raw}" . a . "`n" . b . "`n"
clipboard:= a . "`n" . b . "`n"
clipwait,2
send,^v
clipboard=
return
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Velká písmena s diakritikou

19 Feb 2019, 16:46

so u claim when ure Sending those uppercase funky chars they get automatically converted to lowercase and u dont want that?
i cant reproduce this. v1 1.1.30.01 unicode x64
Image

Code: Select all

str := "Šel jsem k šéfovi"

Gui +AlwaysOnTop -Caption +ToolWindow
Gui Add, Button, , Send String
Gui Show
Return

ButtonSendString:
	WinActivate % "ahk_exe notepad.exe"
	Send % str
Return
semi-related, idk why ure suggesting FileEncoding as a solution here
garry
Posts: 3770
Joined: 22 Dec 2013, 12:50

Re: Velká písmena s diakritikou

19 Feb 2019, 18:53

@swagfag , thank you , you mean the normal send function is ok also
( had also success with clipboard / ^v )

Code: Select all

FileEncoding, UTF-8
a=normal: áčďéěíňóřšťúůýž
b=SHIFT: ÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ
pr=notepad.exe
sc=ahk_exe notepad.exe
$F4::
IfWinNotExist,%sc%
{
Run, %pr%,,,pid1
WinWait,%sc%
}
IfWinNotActive ,%sc%,,WinActivate,%sc%
WinWaitActive,%sc%
send,%a%`n%b%`n
;;sendraw,%a%`n%b%`n
;;sendinput, % "{raw}" . a . "`n" . b . "`n"
;clipboard:= a . "`n" . b . "`n"
;clipwait,2
;send,^v
;clipboard=
return
esc::exitapp
otto_stepan
Posts: 7
Joined: 19 Feb 2019, 05:10

Re: Velká písmena s diakritikou

20 Feb 2019, 03:38

Okay. I must use the clipboard.
ERROR IN AHK! Send command does not work correctly, must send the same string as its parameter!
One-line script is unusable for the Czech language!
Example:
$F4:: send, ÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ
garry
Posts: 3770
Joined: 22 Dec 2013, 12:50

Re: Velká písmena s diakritikou

20 Feb 2019, 06:17

solution from user helgef :
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=62185

Code: Select all

$F4:: send {text}ÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: downstairs, filipemb, OrangeCat and 163 guests