Jump to content

FF.au3 (V0.6.0.1b-10)


Stilgar
 Share

Recommended Posts

Enters the frame without error, but still can't apply the values.

#include <FF.au3>

ShellExecute('https://www.portaldasfinancas.gov.pt/pt/CD/inicio.action')
WinWaitActive('Mozilla Firefox')
_FFConnect ()
Sleep(2000)
_FFLoadWait(0, False)
_FFFrameEnter('loginBox', 'id')
_FFSetValue('123', '_username', 'name')
_FFSetValue('123', 'form_senhaNIF', 'id')
_FFSetValue('456', '_password', 'name')
_FFSetValue('123', 'form_senhaNIF', 'id')
_FFFrameLeave()
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

IDK. I haven't worked with the frame related functions. I also haven't been using __FFSetValue. You may want to try something like the following:

_FFXPath("//form//input[@name='" & $cField & "']")
            _FFCmd("FFau3.xpath.value='" & $cValue & "'")

where $cField is the desired field and $cValue is the new value.

Link to comment
Share on other sites

Thank you for your help, but it still doesn't work, example:

$cField = '_username'
$cValue = '123'

_FFXPath("//form//input[@name='" & $cField & "']")
_FFCmd("FFau3.xpath.value='" & $cValue & "'")

Gives out:

_FFXPath ==> Error return value: _FFXPath_Error: TypeError: FFau3.WCD is undefined

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

Last one.

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

Thank you for your help.

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

  • 4 weeks later...

Hi, folks!

Do anybody here know some way to send a "Save Image As" instruction when the mouse cursor is over an image link? My script has a hotkey assigned to this instruction, but I want to avoid to send mouse right-click to open the context-menu, is it possible using FF.au3?

Thanks in advance.

RegiOween

Link to comment
Share on other sites

Perhaps you can make use of this routine:

$pos = MouseGetPos()

_FFGetMouseElement($pos)

$nodename = _FFCmd("FFau3.xpath.nodeName")

If $nodename = 'IMG' Then
 $src = _FFCmd("FFau3.xpath.src")

 ; Now use InetGet or alt method to download image

Endif

Func _FFGetMouseElement($aPoint)
    Local $aFFPos, $hWindow

    $hWindow = WinGetHandle(_FFCmd("document.title"))

    $aFFPos = _ScreenToClient($hWindow, $aPoint[0], $aPoint[1])

    ; Adjust Y value for height of Tabs, Toolbars, etc
    $aFFPos[1] -= _FFCmd("window.content.mozInnerScreenY - window.mozInnerScreenY")

    _FFCmd("FFau3.xpath=FFau3.WCD.elementFromPoint(" & $aFFPos[0] & ", " & $aFFPos[1] & ");")
EndFunc

Func _ScreenToClient($h_wnd, $i_x, $i_y); Returns an array, [0] = x, [1] = y
    If IsString($h_wnd) Then $h_wnd = WinGetHandle($h_wnd)

    Local $t_xy_coords = DllStructCreate("int x; int y")
    DllStructSetData($t_xy_coords, "x", $i_x)
    DllStructSetData($t_xy_coords, "y", $i_y)

    DllCall("user32.dll", "int", "ScreenToClient", "hwnd", $h_wnd, "ptr", DllStructGetPtr($t_xy_coords))

    Local $a_ret_coords[2] = [DllStructGetData($t_xy_coords, "x"), DllStructGetData($t_xy_coords, "y")]
    Return $a_ret_coords
EndFunc
Link to comment
Share on other sites

Perhaps this can help, and i know it's not what you're looking for, exactly...

https://addons.mozilla.org/en-US/firefox/addon/save-image-in-folder/

After setting the default folder to download the images to, you just

double click on the image and it will download to that folder, no popups or anything.

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

DanP2, thanks for your response. I tested your method, and it works very well, despite a little bit more complex than mine. I can get the image url, just sending right-click to open the context-menu, and then using the shortcut keys "a" (Copy Link Location) or "v" (Save Image As).

Maybe my question wasn't quite clear, but what I wish is to open the Firefox context-menu without actually sending the right-click, cause my intention is to run this script with the right-mouse button blocked, just to avoid open the context-menu when it's not required by the script.

Careca, thanks for your response too, but like you already said, that's not exactly what I was looking for.

Link to comment
Share on other sites

Hello,

When Using FF UDF how do I set a drop down value.

Below is the HTML code .

I have not been able to get it to work using

_ffsetvalue or _FFFormOptionselect

I want to set the values for

 

ENVNAME

REPORTTYPE

 

 

<form name="SSGRform" id="SSGRform" method="post" action="/cgi-bin/SSGR/ssgrSelection.pl" onreset="resetForm();" onsubmit="return ValidateForm(this);">
 <input type="hidden" name="TAB" value="ops_ActionMenu.html">
 <input type="hidden" name="USER" value="xxx45678">
 <input type="hidden" name="GIVENNAME" value="Paul">
 <input type="hidden" name="PERSONNUMBER" value="12345678">
 <input type="hidden" name="CN" value="Schrader, Paul K.">
 <input type="hidden" name="EADDR" value="paul.k.schrader@xxxxxxx.com">
<table style="text-align: left; border="0" cellpadding="1" cellspacing="1"> <tbody>
 <tr><td id="pageContent" style="text-align: left; vertical-align: top;">
    Select an Environment:&nbsp; &nbsp;<select name="ENVNAME">
     <option value="CDSN PROD" selected>Production</option>
     <option value="CDSN QA">QA/Stage/PreProd</option>
     <option value="CDSN SIT">SIT</option>
     <option value="CDSN DEV">Development</option>
    </select><br>
    Select Report Type: &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<select name="REPORTTYPE">
     <option value="grpmember">Group/Role Member
     <option value="grpadmin">Group/Role Administrator
     <option value="appadmin">Application Administrator
    </select><br>
    Enter Application/Group/Role Name/AIT#: <input type="text" class="input" name="searchValue" size="70" maxlength="120"><br> &nbsp; &nbsp;
    <font size=-2><i>1. Enter complete or partial application/group/role name/ait#. <br> &nbsp; &nbsp; 2. To enter more than one application/group/role name/ait#, separate them with semicolon, eg: grp;ait#;role <br> &nbsp; &nbsp; 3. To search all groups/roles of an application, enter its subtree as "dit:ou=appsubtrees", eg: dit:ou=gmi,ou=cognosbi</i></font>
    <p></td>
 </tr>
<tr><td><input id="reset" name="reset" value="Reset" type="reset"> &nbsp; <input id="submit" name="submitpn" value="Submit" type="submit"> <br>
<div id="processing"><img src="/SSGR/images/running_dog.gif" width="200" height="35" border="0" alt="processing"></div></td></tr>
</tbody></table></form></td></tr>
</table> </td> </tr> <tr> <td> <img src="/SSGR/images/bacfooter.gif" alt=""> </td> </tr></body>
</html>

Link to comment
Share on other sites

You may want to rethink your approach to solving this issue.

Yes, your way is less complex. I would guess that it is also less reliable. 

 

DanP2, I ended up sending double-right-click instead of single-right-click to open the context-menu, as the single-click is disabled, but I completely agree with you, this is definitely not the most reliable way to achieve my desired goal, despite it works reasonably well, so I'm still looking for a better way.

Once again, thanks for trying to help.

Link to comment
Share on other sites

HighlanderSword,

this is how i would do:

_FFSetValue('CDSN DEV', 'ENVNAME', 'name')
_FFSetValue('grpadmin', 'REPORTTYPE', '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

So im a bit confused about this:

this code:

$Val = _FFObjGet('input_cx1', 'id')
        ConsoleWrite('CGD ' & $Val & @CRLF)
        If $Val = @error Or '' Then ;<<<<<<<<<<<< Either Error OR Empty string to proceed...
            ConsoleWrite('CGD ' & 'Not Found or Error' & @CRLF)
        Else

retrieves

_FFConnect: OS:    WIN_7 WIN32_NT 7601 Service Pack 1
_FFConnect: AutoIt:    3.3.8.1
_FFConnect: FF.au3:    0.6.0.1b-3
_FFConnect: IP:    127.0.0.1
_FFConnect: Port:    4242
_FFConnect: Delay:     2ms
_FFIsConnected ==> Socket Error: -1
_FFConnect: Socket:     580

_FFConnect: Browser:    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0
__FFSendJavaScripts: Sending functions to FireFox .......... done
CGD OBJECT|.getElementById('input_cx1') ;<<<<<<<<<<Bang! Found the item.
CGD Not Found or Error

Looking at the notes related to _FFObjGet, i can see that it has succeeded, no error, or empty string,

but, it still responds as if it has been an error OR an empty string... :S

; Name ..........: _FFObjGet
; Description ...: Returns an object (string to use with the other _FFObj* functions)
; Beschreibung ..: Liefert ein Object zurueck. (String zur Verwendung mit den anderen _FFObj* Funktionen)
; AutoIt Version : V3.3.0.0
; Syntax ........: _FFObjGet($sElement[, $sMode = "id"[, $iIndex = 0]])
; Parameter(s): .: $sElement    -
;                  $sMode       - Optional: (Default = "id") :
;                               | ID
;                               | Name + index
;                               | Class + index
;                               | Tag-name + index
;                  $iIndex      - Optional: (Default = 0) :
; Return Value ..: Success      - String (object to use in the _FFObj* functions)
;                  Failure      - Epmty string
;                  @ERROR       -
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

Hello,

When I try

#include <C:Work DataAutoIt ScriptsFirefoxff.au3>

_ffstart()
_FFOpenURL("https://cdsnfeed.bankofamerica.com:9099/usergroupreport/")

_FFSetValue('grpadmin', 'REPORTTYPE', 'name')

 

It does not work, below are the messages. 

 

"C:Program Files (x86)Mozilla Firefoxfirefox.exe" -new-window "about:blank"
__FFStartProcess: ""C:Program Files (x86)Mozilla Firefoxfirefox.exe" -new-window "about:blank"
_FFConnect: OS: WIN_7 WIN32_NT 7601 Service Pack 1
_FFConnect: AutoIt: 3.3.8.1
_FFConnect: FF.au3: 0.6.0.1b-3
_FFConnect: IP: 127.0.0.1
_FFConnect: Port: 4242
_FFConnect: Delay:  2ms
_FFConnect: Socket:  608
_FFConnect: Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0
__FFSendJavaScripts: Sending functions to FireFox .......... done
_FFLoadWait: . loaded in 10ms
_FFOpenURL: https://cdsnfeed.bankofamerica.com:9099/usergroupreport/
__FFSend: try{window.content.top.document.location.href='https://cdsnfeed.bankofamerica.com:9099/usergroupreport/'}catch(e){'_FFCmd_Err';};
__FFRecv: https://cdsnfeed.bankofamerica.com:9099/usergroupreport/
_FFLoadWait: .... loaded in 867ms
__FFSend: try{FFau3.WCD=window.content.top.document;}catch(e){'_FFCmd_Err';};
__FFRecv: [object HTMLDocument] - {location: {...}, querySelector: function() {...}, querySelectorAll: function() {...}, evaluate: function() {...}, createExpression: function() {...}, createNSResolver: function() {...}, addEventListener: function() {...}, ...}
__FFSend: try{window.content.top.document.getElementsByName('REPORTTYPE')[0].value='grpadmin'}catch(e){'_FFCmd_Err';};
__FFRecv: _FFCmd_Err
_FFSetValue ==> No match: $sElement: .getElementsByName('REPORTTYPE')[0]
+>07:42:00 AutoIT3.exe ended.rc:0
>Exit code: 0    Time: 7.535

Link to comment
Share on other sites

DanP2, thanks for your response. I tested your method, and it works very well, despite a little bit more complex than mine.

 

DanP2, I ended up sending double-right-click instead of single-right-click to open the context-menu, as the single-click is disabled, but I completely agree with you, this is definitely not the most reliable way to achieve my desired goal, despite it works reasonably well, so I'm still looking for a better way.

 

What's your reasoning for avoiding using the method I posted?

Link to comment
Share on other sites

HighlanderSword, that link is invalid, i mean, i cant open it in the browser, so how would the rest of the code work?

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...