Jump to content

FF.au3 (v0.6.0.1b-15) [End of life]


Danp2
 Share

Recommended Posts

  • 4 weeks later...

Sorry, I was sure I said thank you.

My project has evolved and now I need to know: is there a way to intercept Firefox error notifications? For instance, if Flash crashes, or plugin-container. Is it possible to "read" somewhere these events in order to set a reaction? I have a thread here https://www.autoitscript.com/forum/topic/178852-how-to-check-if-a-process-is-responding/ 

 

Link to comment
Share on other sites

  • 2 months later...

I've been working with the FF library for a bit now, and I'm having some issues interacting with HTML elements.

Take this script for example, that I built to prove the process I will need to use.

Local $FF_url_start = "https://www.youtube.com/";"https://zenoss.ops.absolute.com/"
_FFStart($FF_url_start)
WinActivate("[Title:YouTube - Mozilla Firefox]")
Local $FF_element = _FFObjGet("News","title")
Local $FF_pos = _FFGetPosition($FF_element)
_FFClick($FF_element)

The code should open a new firefox window and load Youtube, and then click the "News" button on the left hand side, and then put the position of that html object into a variable for me to use.

My issue is that it does not click the button, and the co-ordinates it gives me are horribly incorrect. What am I doing wrong? 

Here is my autoit's debug log:

_FFConnect: OS: WIN_7 WIN32_NT 7601 Service Pack 1
_FFConnect: AutoIt: 3.3.14.2
_FFConnect: FF.au3: 0.6.0.1b-15
_FFConnect: IP: 127.0.0.1
_FFConnect: Port:   4242
_FFConnect: Delay:  2ms
_FFConnect: Socket:     552
_FFConnect: Browser:    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0
__FFSendJavaScripts: Sending functions to FireFox .......... done
_FFLoadWait: . loaded in 10ms
[object HTMLDocument] - {logoutForm: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, write: function() {...}, ...}
_FFObjGet ==> Invalid value: (id|name|class|tag) $sMode: title
__FFSend: try{window.content.top.document.location.href}catch(e){'_FFCmd_Err';};
__FFRecv: https://www.youtube.com/
__FFSend: try{window.content.top.document.title}catch(e){'_FFCmd_Err';};
__FFRecv: YouTube
__FFSend: try{FFau3.tmp=document.title;document.title='FFAU31116941983'}catch(e){'_FFCmd_Err';};
__FFRecv: FFAU31116941983
__FFSend: try{document.title=FFau3.tmp}catch(e){'_FFCmd_Err';};
__FFRecv: YouTube - Mozilla Firefox
_FFWindowGetHandle: 0x00100596
__FFSend: try{FFau3.simulateEvent(,'MouseEvents','click');}catch(e){'_FFCmd_Err';};
__FFSend: ;

__FFWaitForRepl ==> Error return value: MozRepl ....>
__FFRecv: 
_FFClick ==> No match: $sElement: 
__FFSend: try{window.content.top.document.getElementById('exceptionDialogueButton')?1:0;}catch(e){'_FFCmd_Err';};
__FFRecv: !!! SyntaxError: expected expression, got ','

Details:


 0
_FFObjGet ==> No match: $sElement not found: exceptionDialogueButton
__FFSend: try{FFau3.simulateEvent(,'MouseEvents','click');}catch(e){'_FFCmd_Err';};
__FFSend: ;

__FFWaitForRepl ==> Error return value: MozRepl ....>
__FFRecv: 
_FFClick ==> No match: $sElement:

 

Link to comment
Share on other sites

It's been a while since I checked, but last time I looked Stilgar was releasing updates to the UDF over on the German forum. My intent was never to "take over" development of this UDF. Perhaps he can be persuaded to reengage with this forum so that we can continue to benefit from his efforts.

Link to comment
Share on other sites

  • 1 month later...

I have a strange behaviour.

 

I'm trying to click an item, the console seems okay but the item isn't actually clicked

 

here is my code:

_FFConnect(Default, Default, 3000)
$setSymbol = _FFObjGet("quote_EURUSD", "id") ;
_FFClick($setSymbol);

and here is the log

 

>"E:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "E:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Jeff\Desktop\FFtest.au3" /UserParams    
+>13:53:02 Starting AutoIt3Wrapper v.16.306.1237.0 SciTE v.3.6.2.0   Keyboard:0000040C  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64  Environment(Language:040C)  CodePage:0  utf8.auto.check:4    # detect ascii high characters and if none found set default encoding to UTF8 and do not add BOM
+>         SciTEDir => E:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\Jeff\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\Jeff\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.2)  from:E:\Program Files (x86)\AutoIt3  input:C:\Users\Jeff\Desktop\FFtest.au3
+>13:53:02 AU3Check ended.rc:0
>Running:(3.3.14.2):E:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\Jeff\Desktop\FFtest.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
_FFConnect: OS: WIN_7 WIN32_NT 7601 Service Pack 1
_FFConnect: AutoIt: 3.3.14.2
_FFConnect: FF.au3: 0.6.0.2b
_FFConnect: IP: 127.0.0.1
_FFConnect: Port:   4242
_FFConnect: Delay:  2ms
_FFConnect: Socket:     548
_FFConnect: Browser:    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
__FFSendJavaScripts: Sending functions to FireFox .......... done
__FFSend: try{window.content.top.document.getElementById('quote_EURUSD')?1:0;}catch(e){'_FFCmd_Err';};
__FFRecv: 1
__FFSend: try{FFau3.simulateEvent(FFau3.WCD.getElementById('quote_EURUSD'),'MouseEvents','click');}catch(e){'_FFCmd_Err';};
__FFRecv: 1
_FFLoadWait: . loaded in 24ms
[object HTMLDocument] - {flashFilesList: {...}, videoFilesList: {...}, location: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, ...}
+>13:53:04 AutoIt3.exe ended.rc:0
+>13:53:04 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 2.068

webpage is https://demo.ayrex.com/

 

thanks!

 

Jeff

Link to comment
Share on other sites

  • 1 month later...

I'm experiencing a problem with _FFTabSetSelected().  If there is a better place to post this, please let me know...

The problem is that the function keeps returning with invalid combinations of return value and @error (at least if I understand the extremely limited documentation correctly).  For example, the function can return a value of 2 with @error set to 0, or a return value of 0 with @error set to 2 -- neither of which the documentation describes or seems to allow (see: http://english.documentation.ff-au3.thorsten-willert.de/ff_functions/_FFTabSetSelected.php )

Let me explain what I'm trying to do (because perhaps there's a better way). What I really want is a list of the labels of all the tabs currently open in Firefox. Since I can't find any function to actually do that in one call, I'm taking a brute-force approach of looping through every tab, one at a time, and setting the current tab to a specific index in the loop, then obtaining the label associated with that tab.

Here's a code snippet:

For $i = 0 To $L_TotalTabCount
    $L_Stat = _FFTabSetSelected( $i, "index" )      ; Force/Set the selected tab 
    If $L_Stat <> 1 Then
        ; Error handling
    EndIf
    $L_CurTabLbl = _FFTabGetSelected("label")       ; Get the label of the currently selected tab
Next

But occasionally $L_Stat is set to 2 (which is unexplained), but most often it's set to 0 and @error is set to 0 (which should never happen, also according to the documentation).

At first, I thought this might be related to the fact that I love and use the TabMixPlus addon, and I found an old comment on the fora that noted there was a problem if that addon was being used (but I have no idea if that's still an issue now in May 2016). In any event, I disabled it and re-started, but that didn't resolve the issue.

Any ideas?  Or maybe there's a better way of controlling Firefox with Autoit?

Thanks!

Edited by Mbee
Improved explanations
Link to comment
Share on other sites

  • 2 weeks later...

i have some strange problem :

#Include "FF.au3"

If _FFConnect() Then
    MsgBox(64,_FFIsConnected(),"Connected")
    _FFOpenURL("https://en.wikipedia.org/wiki/AutoIt")

Else
    MsgBox(64,_FFIsConnected(),"Can't connect to FireFox")
EndIf

it working, URL is opened, but i get "0" from _FFIsConnected() func and also this output:

_FFConnect: OS: WIN_XP WIN32_NT 3790 Service Pack 2
_FFConnect: AutoIt: 3.3.14.0
_FFConnect: FF.au3: 0.6.0.1b-12
_FFConnect: IP: 127.0.0.1
_FFConnect: Port:   4242
_FFConnect: Delay:  2ms
_FFConnect: Socket:     628
_FFConnect: Browser:    
__FFSendJavaScripts: Sending functions to FireFox .......... done
__FFSend: try{FFau3 != null?1:0}catch(e){'_FFCmd_Err';};
__FFRecv: 
_FFIsConnected ==> Socket Error: 628
_FFOpenURL: https://en.wikipedia.org/wiki/AutoIt
__FFSend: try{window.content.top.document.location.href='https://en.wikipedia.org/wiki/AutoIt'}catch(e){'_FFCmd_Err';};
__FFRecv: 
_FFOpenURL ==> No match: https://en.wikipedia.org/wiki/AutoIt

what it can be?

Link to comment
Share on other sites

Yes, with same result.

--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
_FFConnect: OS: WIN_XP WIN32_NT 3790 Service Pack 2
_FFConnect: AutoIt: 3.3.14.0
_FFConnect: FF.au3: 0.6.0.1b-15
_FFConnect: IP: 127.0.0.1
_FFConnect: Port:   4242
_FFConnect: Delay:  2ms
_FFConnect: Socket:     632
_FFConnect: Browser:    
__FFSendJavaScripts: Sending functions to FireFox .......... done
__FFSend: try{FFau3 != null?1:0}catch(e){'_FFCmd_Err';};
__FFRecv: 
_FFIsConnected ==> Socket Error: 632
_FFOpenURL: https://en.wikipedia.org/wiki/AutoIt
__FFSend: try{window.content.top.document.location.href='https://en.wikipedia.org/wiki/AutoIt'}catch(e){'_FFCmd_Err';};
__FFRecv: 
_FFOpenURL ==> No match: https://en.wikipedia.org/wiki/AutoIt
+>05:48:40 AutoIt3.exe ended.rc:0
+>05:48:40 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 103.9

 

Link to comment
Share on other sites

  • 2 months later...
#include <IE.au3>
Local $page = 0

Local $oIE = _IECreate ("http://mywebsite.com/" & $page)

Local $oInputs = _IETagNameGetCollection($oIE, "a")

For $oInput in $oInputs
    if StringInStr($oInput.getAttribute("href"), "dl.php") Then
        _IECreate("http://mywebsite.com/" & $oInput.getAttribute("href"))
    EndIf
Next

Hi, i'm a newbie with AutoIt. I have this script written with IE.au3, how i translate it with FF.au3?

Thanks for the support, the documentation is really poor... I don't find how i can get an object by his tag name (i'm trying to collect all links).

 

Edited by DevPre24
Link to comment
Share on other sites

Welcome to AutoIt and the forum!

This is your first post so do you think it is a good idea to nag about something that is (in your eyes) missing or poor?
All users are volunteers and code or help other users in their spare free time.

The documentation in german/english can be found on page on of this thread.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

2 hours ago, water said:

Welcome to AutoIt and the forum!

This is your first post so do you think it is a good idea to nag about something that is (in your eyes) missing or poor?
All users are volunteers and code or help other users in their spare free time.

The documentation in german/english can be found on page on of this thread.

I don't find Function like _IEGetTagCollection for FF.au3. Can you help me?

Edited by DevPre24
Link to comment
Share on other sites

  • 3 months later...

There are a few comments that the documentation on FF.au3 is not comprehensive.  I'm using this document.  FFGetValue and FFSetValue don't have anything.  Lots of the pages have very brief descriptions, some have no examples.

Is that the latest and best? 

What if all those pages were copied to a new section in the AutoIt Wiki?  Then anyone interested could add comments, questions, examples etc.  The documentation would get better without any one person having to do it all.

 

Link to comment
Share on other sites

  • 4 weeks later...

Hello all, im trying to change the volume in youtube, but can't figure out how to translate it to the UDF.

<div class="ytp-volume-panel"

role="slider"

aria-valuemin="0"

aria-valuemax="100"

tabindex="0"

aria-valuenow="68"

aria-valuetext="68% volume">

<div class="ytp-volume-slider">

<div class="ytp-volume-slider-handle"

style="left: 27.3077px;">

</div></div></div>

Tried many things, but none worked, even changing the value myself through the inspector tool in developer tools doesn't change the volume.

_FFSetValue('50', 'aria-valuenow', 'name')

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
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
 Share

×
×
  • Create New...