Tilde in SendKeysTo string
Keywords: tilde special characters
Question:
I have had to convert long (windows 95) names to shorter 8 character names for my program to
recognize. I am using the SendKeysTo command with a variable that contains my shortened file name.
Somehow, WIN batch is sending the tilde in the file name as a return. This is code right now.... is there
away around this????
SendKeysTo("Layout & Editing", "!fif%shortname%~")
Where shortname is equal to Cardin~1.pec... it types in only cardin before hitting return.
Answer:
Yes SendKeys(etc) interprets a tilde as a return.
Try....
shortname=StrReplace(shortname,"~","{~}") ; NB CURLY braces
SendKeysTo("Layout & Editing", "!fif%shortname%~")
or (much faster):
ClipPut(shortname)
SendKeysTo("Layout & Editing", "!fif^v~") ;paste in filename, followed by a RETURN
Article ID: W13831
Filename: Sending Filename that Contains a Tilde.txt