For an application I have a new script designed to replace the traditional Msgbox. The message is
passed as parameter no. 1. The problem is passing a message that contains quotation marks.
Here an Example:
Code: Select all
;First Script, the Caller
;---------------------------------------------
sFilename:=fnQ("C:\_Autohotkey\Scripts\Apps\VG99\SetGtrToMidi\Files\Brand Guitar.g9e")
sMessage:=sFilename " saved."
MsgBox % sMessage
Run, % "C:\_Autohotkey\Scripts\Forum\newMSGBOX.ahk " sMessage A_Space sTitle A_Space iTimeout
ExitApp
fnQ(sText)
{
return, % """" sText """"
}
Code: Select all
;Second Script, the receiver
;------------------------------------------------------------------------------------------------------------------------
sMessage=%1%
sTitle=%2%
iTimeout=%3%
MsgBox %sMessage%
fnNewMSGBOX(sMessage,sTitle,iTimeout)
ExitApp
fnNewMSGBOX(sMessage,sTitle,iTimeout)
{
... Show new MSGBOX GUI Code
}
"C:\_Autohotkey\Scripts\Apps\VG99\SetGtrToMidi\Files\Brand Guitar.g9e" saved.
my new Msgbox shows:
C:\_Autohotkey\Scripts\Apps\VG99\SetGtrToMidi\Files\Brand Guitar.g9e
Logical because some characters in the passed Message contains quotation marks.
I have already thought about writing the text from the first script to a file, the second
script reads the text back, but that would be unmanageable.
Any ideas ?