Sign in to follow this  
Followers 0
jfcby

Firefox With MozRepl Does Not Work With Multiple Lines of Text

4 posts in this topic

I have a script that sends multiple lines of text to a textbox using Firefox. I using _FFSetValue($sCellValue[7], "line one" & @CR & "line two", "id") from ff.au3. If it's a single line of text it works but MozRepl give the following error with multiple lines of text.

Error:  

__FFSend: try{FFau3.simulateEvent(window.content.top.document.getElementById('line one
line two'),'Event','change',13);}catch(e){'_FFCmd_Err';};

__FFWaitForRepl ==> Error return value: MozRepl ....>
__FFSend: ;
__FFRecv:
__FFSend: FFau3.WCD=window.content.top.document;

__FFWaitForRepl ==> Error return value: MozRepl ....>
__FFRecv: !!! SyntaxError: unterminated string literal

Details:


 [object HTMLDocument] - {mainForm: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, ...}
!!! SyntaxError: unterminated string literal

Will MozRepl plugin for Firefox send multiple lines of text to a textbox?

Thanks for your help.


Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Share this post


Link to post
Share on other sites



Please post a script that we can run to reproduce the issue. Be sure to use a public website that anyone can access.

Also, please provide additional info regarding your setup (ie: AutoIT version, FF.au3 version, etc).

Share this post


Link to post
Share on other sites

I'm using the following...

AutoIt Version: v3.3.6.1
FF.au3 version: V0.6.0.1b-15
Firefox Version: 45.0.2
Excel Version: Microsoft Office Professional Plus 2013

My full script is reading text from a cell in an Excel file that has multiple lines of text.

For example:

Line 1
Line 2
Line 3

Each cell will vary in how many lines each has. Some will have 2 while others will have more.

In order to provide a script that gives the same error that I'm getting run the following script.

#include <FF.au3>
; trying to connect to a running FireFox with MozRepl on
If _FFConnect(Default, Default, 3000) Then

    Local $ET, $ETLS
    ; open a page
    _FFOpenURL("http://frankiecooper.com/contact/")
    Sleep(3000)

    $ET1 = "Example Text Line 1"
    $ET2 = "Example Text Line 2"
    $ET3 = "Example Text Line 3"

    $ETLS = $ET1 & @LF
    $ETLS &= $ET2 & @LF
    $ETLS &= $ET3
    MsgBox(0, "", $ETLS)

    _FFSetValue($ETLS , "fscf_field1_3", "id") ;

    ; disconnect from FireFox
    If _FFDisConnect() Then MsgBox(64, "", "Disconnected from FireFox!")
Else
    MsgBox(64, "", "Can't connect to FireFox!")
EndIf

 

Thanks for your help.


Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Share this post


Link to post
Share on other sites

I'm not a big user of _FFSetValue. Here's how I would do it --

#include <FF.au3>
; trying to connect to a running FireFox with MozRepl on
If _FFConnect(Default, Default, 3000) Then

    Local $ET, $ETLS
    ; open a page
    _FFOpenURL("http://frankiecooper.com/contact/")
    Sleep(3000)

    $ET1 = "Example Text Line 1"
    $ET2 = "Example Text Line 2"
    $ET3 = "Example Text Line 3"

    Local $cField = 'fscf_field1_3'
    Local $NL = '\n'

    $ETLS = $ET1 & $NL
    $ETLS &= $ET2 & $NL
    $ETLS &= $ET3

    _FFXPath("//textarea[@id='" & $cField & "']")
    _FFCmd("FFau3.xpath.value='" & $ETLS & "'")

    ; disconnect from FireFox
    _FFDisConnect()
Else
    MsgBox(64, "", "Can't connect to FireFox!")
EndIf

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • tonycst
      By tonycst
      I want to pass "about:config" to firefox
      If i do ShellExecute ("firefox.exe","about:config"), i get new instance of firefox opening up which is bad because it makes changes to another profile instead of one that is currently running.
      Any ideas ?
    • mazz3d
      By mazz3d
      hello  everyone,
      I'm new with AutoIT and just looking for a way to open Firefox with random window size
      i have tried too many different samples from the web, some how it works but i can't make it works with Firefox 
      MozRpel and ff.au3 installed 
      right now i can open Firefox with this code, but i still can't control the window of Firefox
      ; open firefox #include <ff.au3> _FFStart() ; open firefox with random size  
    • danielzy
      By danielzy
      Hey guys, I'm pretty new to autoit and I'm trying to use FF.au3 to extract some cells from a table which looks like that:
       
      <table border="0" cellspacing="5" cellpadding="1"> <tr> <td class="BlueInputKind" align="left" nowrap>HEADING1</td> <td class="BlueInputKind" nowrap>HEADING2</td> <td class="BlueInputKind" nowrap>HEADING3</td> <td class="BlueInputKind" nowrap>HEADING4</td> </tr> <tr> <td class="BlackTextEng" dir="ltr">Text1</td> <td class="BlackTextCenter" valign="top" dir="rtl">Number</td> <td nowrap class="BlackText" valign="top" nowrap>Text3</td> </tr> <tr> <td class="BlackTextEng" dir="ltr">Text1</td> <td class="BlackTextCenter" valign="top" dir="rtl">Number</td> <td nowrap class="BlackText" valign="top" nowrap>Text3</td> </tr> <tr> <td class="BlackTextEng" dir="ltr">Text1</td> <td class="BlackTextCenter" valign="top" dir="rtl">Number</td> <td nowrap class="BlackText" valign="top" nowrap>Text3</td> </tr> My end goal is to:
      If Text1 == something && Number > SomeNumber Then DoSomething I managed to connect to firefox using repl and clicked some links etc but I'm not even close to achieving something like the above. Any help will be appreciated.
    • emrecnl
      By emrecnl
      hello I'm using a firefox script to access a web url, it's gathering weblogin url, username password etc from another server, but it fails because each time it runs firefox it launches with default firefox wizards such as importing bookmarks from IE and then a popup to check whether firefox is default browser or not.
       
      how can I prevent this? what kind of code should I add?
      if needed I can also share the script.
    • emrecnl
      By emrecnl
      Well I guess my title summarizes the question.
      What do I need to change in script? Should I only edit IE paths to Firefox?