blaat34 Posted March 30, 2015 Share Posted March 30, 2015 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? $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) Link to comment Share on other sites More sharing options...
JohnOne Posted March 30, 2015 Share Posted March 30, 2015 If you have double quotes in your string, you should encase them in single quotes. FileWrite($hFileOpen,'text {findWhat:"#PR"} {changeTo:" & $PR & "} {includeFootnotes:false, includeMasterPages:false, includeHiddenLayers:true, wholeWord:false}' & @CRLF) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
blaat34 Posted March 30, 2015 Author Share Posted March 30, 2015 thanks man, only my $PR input doesn't work, is there anyway i could make that work? Link to comment Share on other sites More sharing options...
JohnOne Posted March 30, 2015 Share Posted March 30, 2015 Sure, and I'd be glad to help if you can do a little better than "doesn't work" AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
blaat34 Posted March 30, 2015 Author Share Posted March 30, 2015 ha, sorry man thanks for helping out. actually i found a solution! Link to comment Share on other sites More sharing options...
JohnOne Posted March 30, 2015 Share Posted March 30, 2015 Ace. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now