Hi,
I want to use an Inputbox to write a line that i will later use with Java/Indesign:
The problem line keeps getting me errors, what am i doing wrong?
AutoIt
$PR = InputBox("PR", "Enter the 1 or 2 character code.") Example() Func Example() ; Create a constant variable in Local scope of the filepath that will be read/written to. Local Const $sFilePath = @TempDir & "\FileWrite.txt" ; Open the file for writing (append to the end of a file) and store the handle to a variable. Local $hFileOpen = FileOpen($sFilePath, $FO_APPEND) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.") Return False EndIf ; Write data to the file using the handle returned by FileOpen. FileWrite($hFileOpen,"text {findWhat:"#PR"} {changeTo:" & $PR & "} {includeFootnotes:false, includeMasterPages:false, includeHiddenLayers:true, wholeWord:false}" & @CRLF) FileWrite($hFileOpen, $TEST & @CRLF) ; Close the handle returned by FileOpen. FileClose($hFileOpen)
The problem line is:
FileWrite($hFileOpen,"text {findWhat:"#PR"} {changeTo:" & $PR & "} {includeFootnotes:false, includeMasterPages:false, includeHiddenLayers:true, wholeWord:false}" & @CRLF)