Sign in to follow this  
Followers 0
pctechtv

FF.au3 MozRepl Questions

6 posts in this topic

I see some of the info on using MozRepl functions with AutoIt, it looks incredible! I want to ask here because I don’t know if I am thinking about it in the correct way, to solve my problem. I want to automate opening Firefox, going to a URL, and then saving the page with Mozillas Archive Format (MAFF). I need Firefox because they are the only ones who do it (MAFF). Once the file is saved I want the browser to close. The use of a text based script here is really good because I can make the creation of it dynamic. I am doing this part with another application and I have that part working. What I have not been able to get, up to now, is a reliable way to open Firefox, go to URL, then "Save As", and then close all. Looking at MozRepl I don’t see anything that can open Firefox until it is open and connected to MozRepl... correct? Are the function in MozRepl able to do this? Are they able to get access to "Save As". I am going test with it some because looking at example of what it can do it seems like a good thing to have access to. But I would like to help to see if my immediate need can be met with it. Thanks

To be clear her are the steps I want to accomplish.
1. Open Firefox with URL
2. "Save As" (Firefox - Mozilla Archive Format MAFF)
3. Close the "Save As" window
4. Close Firefox.

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

So I can see how MozRepl is helpful with something like the _FFLoadWait() I was not able to figure out how to do that without it. I don't think I am using it 100% correct that is why I have the SLEEP(3s) set. I seem to have better results with some of the native AutoIt functions once in the windows. I could not get anything to happen with things like _FFControlSend, please if anybody know good suggestions on some to try for this case send them to me. Note if I did not have the MAFF Firefox extension installed this would be the same as using the Firefox default save option. Here is what I so far have some decent result with. Thanks

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.12.0
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <FF.au3>
$Path = "C:\Export"
$FileName = "testFile"
$goodWinRx = "[REGEXPTITLE: - Mozilla Firefox$]"
$goodWinRx2 = "[REGEXPTITLE: eBay - Mozilla Firefox$]"
$link = "http://en.wikipedia.org/wiki/Cayenne_pepper"

Run("C:\Program Files (x86)\Mozilla Firefox\firefox.exe")
;_FFStart()
If _FFConnect() Then
_FFOpenURL($link)
    If _FFLoadWait() Then

        ControlSend("[CLASS:MozillaWindowClass]", "", "", "^s")
        SLEEP(500)
        SEND($FileName)
        SLEEP(500)
        SEND("!d")
        SEND($Path)
        ;ControlSend("[CLASS:MozillaWindowClass]", "", "", "{ENTER}")
        ;ControlSend ( "Save As", "", "", "{ENTER}" )
        ControlClick("Save As", "", "[CLASS:Button; INSTANCE:1]")

        ;MsgBox(0,"","Yes!")
    EndIf
EndIf
SLEEP(3000)
_FFQuit()
Exit
Edited by pctechtv

Share this post


Link to post
Share on other sites

I have never heard of MAFF. I looked it up. Do you want to save all tabs? Is there a keystroke combination that will do what you want it to do to save these?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

 Do you want to save all tabs?

Thanks, no I want to use what I find to be the greatest way to keep a version of a page that you see now. Various sites tend to have important data that you may see and need for you purposes. The problem with other save format is they lack the ability to save all content and keep it exactly like it was when you viewed it. People sometimes say "you could just take a screen shot" but that misses the robustness that a web page is supposed to have, to put it simply you can’t event copy and paste when you do that. MAFF is a Mozilla format that makes and encapsulated version of a page in an archive format that is accessible via things like Winrar and 7zip. The great thing about it though is that the actual archive when double clicked on, will open up just like a HTML file. Every single part of the file exactly like you accessed it. No singe part dynamically changing, like the the other save and archive formats allow. All other archive formats to me fall short.

There is no short cut, it becomes one of the "Save As" choices once you have it installed. That is why I am saying that I just want to save the page. So I guess the answer to what you graciously ask is yes, "Ctrl S" this also gives many choice of save formats but from what I have seen MAFF is the only one that really gives a true archive. Will stay there as the default once used. The file it save also presents its self nice in the browser with the original link and time accessed at the top.

I am finding it interesting that automating a program (something I do all the time) just to open, go, and save, is this challenging, but I see and have learned how Firefox can be a different animal. The learning and new things I have discovered are great though! AutoIt is incredible! MozRepl, bananas! This form looks incredible, such a wealth.

I want to open Firefox
Go to a page
Save the page (Ctrl S)
Close Firefox

Thanks so much!

Edited by pctechtv

Share this post


Link to post
Share on other sites

I call what I am doing so far progress I seem to be getting more reliable interaction with the Firefox Save as window but I am stuck here.... according to the documentation I should be able to obtain info about the Save As window via the Window Info Tool. I can't seem to access one of the areas. I got the file name fine and controled it with ControlSend but I cannot seem to get the Windows Path area. I am trying thing like so:

Local $hWnd = WinWait("[CLASS:ToolbarWindow32]", "", 1)
ControlClick($hWnd, "", "[CLASS:ToolbarWindow32; INSTANCE:4]")

Thanks

 

findControlHelp.png

Share this post


Link to post
Share on other sites

Have you looked into using their API?

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