Jump to content
Sign in to follow this  
Vercuz

Sending JS via FF.au3 UDF

Recommended Posts

Vercuz

Hello. 

I need to execute this script

var i;
var select = document.getElementById("test");
for(i=1;i<select.options.length;i++) {
  select.options[i].selected=false;
}

Using autoit with FF.au3.

I tried using it like - 

_FFCmd('var i;var select = document.getElementById("test");for(i=1;i<select.options.length;i++) { select.options[i].selected=false;}');

But it doesn't work.

_FFConnect: AutoIt: 3.3.14.1
_FFConnect: FF.au3: 0.6.0.1b-15
_FFConnect: IP: 127.0.0.1
_FFConnect: Port:   4242
_FFConnect: Delay:  2ms
_FFConnect: Socket:     696
_FFConnect: Browser:    Mozilla/5.0 (Windows NT 6.3; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0
__FFSendJavaScripts: Sending functions to FireFox .......... done
__FFSend: try{var i;var select = document.getElementById("test");for(i=1;i<select.options.length;i++) {  select.options[i].selected=false;}}catch(e){'_FFCmd_Err';};
__FFRecv: _FFCmd_Err

If I paste it manually into firebug it works. I need to reset two selects inside a form on page but_FFFormReset() sometimes doesnt work for me.

Thank you in advance and best regards ;)

 

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  

  • Similar Content

    • DynamicRookie
      By DynamicRookie
      Hey There!
       
      So, what i need to do is an app that can read text in a image (I.e. a png that has text saying "This is a png" and return the text to a variable)
      I'm pretty much a newbie on AutoIt, my purpose is doing that but i don't know any function that can

      Any help is much appreciated
    • santoshM
      By santoshM
      How can i exit from a procedure in auto
      Func test() if x=o then     return endif endFunc  
    • Valnurat
      By Valnurat
      Hi
      Small question.
      I trying to find all index in an array with value higher than 7.
      How can that be possible?
    • TrashBoat
      By TrashBoat
      Could someone help me create or give an idea of how to do a incrementing for loop that would do this: https://i.imgur.com/YFUt47H.gifv
      I'm having a hard time figuring it out :S
    • msd1994
      By msd1994
      I have a script that just adds some keyboard shortcuts for things like displaying the current song and artist, moving the window to the side so it won't pop up in my way, and play/pause, next song, previous song (these are the only 3 to still work since they don't need the window handle.)
      In some update recently, Spotify's window class swapped from "[CLASS:SpotifyMainWindow]" to "[CLASS:Chrome_WidgetWin_0]". Using the new class in my controls doesn't seem to work, I've tried getting the window handle from the process handle (_GetHwndFromPID($PID)) but that seems to fail as well.
      Does anybody have some idea of a way I could get this script working again?
       
      edit: seems like discord has the same window class name, so could be some issue with this? Still not sure of a way to solve the issue though, I added a function to get the handle of the active window and can just use that now, but it was able to find it on its own before on spotify startup or script startup which would be preferred.
       
      Thanks!
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.