JavaScript to save MAFF in Firefox

I am experimenting with iMacros (Firefox add-on) to automate as task that Firefox will do. I simply want to save the current page with the MAFF extension. The JavaScript that the iMacros forum has lead me to, is this:
// I stuck these variable in just to try something.
var doc = "http://www.traderjoes.com";
var file = "C:\\Export\\Test.maff";
var format = "MAFF";
// I stuck these variable in just to try something.
var MafObjects = {};
Components.utils.import("resource://maf/modules/mafObjects.jsm",
MafObjects);
var jobListener = {
onJobComplete: function(aJob, aResult) {
if (!Components.isSuccessCode(aResult)) {
// An error occurred
} else {
// The save operation completed successfully
onJobProgressChange: function(aJob, aWebProgress, aRequest,
aCurSelfProgress,
aMaxSelfProgress,
aCurTotalProgress,
aMaxTotalProgress) { },
onStatusChange: function(aWebProgress, aRequest, aStatus,
aMessage) { }
var saveJob = new MafObjects.SaveJob(jobListener);
saveJob.addJobFromDocument(doc, file, format);
saveJob.start();
I was only getting an error on line 26 because this was sample code. With the little JavaScript I know I tried to add some variables on the lines before the code starts. The thing is that when I try to search for syntax example for the method .addJobFromDocument I don’t find much, just like two results. Is this a method of JavaScript? Usually with things from the DOM you will get a great deal of information on them.
Does anybody know a way of automating the save of MAFF of the current open tab in Firefox and then closing the browser? iMacros was something I came to and glad to see it features but really I just want to automate from a command line the saving of a URL as a MAFF archive The doc (that I got from iMacros forum) also had these code snippets but I don’t have much idea how to use them. Thanks
var fileUri = Components.
classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService).
newFileURI(file);
var persistObject = new MafObjects.MafArchivePersist(null, format);
persistObject.saveDocument(doc, fileUri);
Also:
var doc = gBrowser.contentDocument;
var file = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile);
file.initWithPath("C:\\My Documents\\Test.maff");
var format = "TypeMAFF";

The location for application folder level scripts was changed with Acrobat/Reader 10.0.1.1 update.
You may need to use the "app.getPath" method to locate the exact location for your scriipts or verify the location.

Similar Messages

  • How can I save my current Firefox customization to install on a new Windows 7 installation

    This is not asking for a problem fix.
    How can I save my current Firefox 3.6 customization, toolbar set-up, plug-ins, add-ons, etc. to a file or files so I can install it, pre-customized, after I do a re-format and clean install of a new Windows 7 operating system?
    I am currently in Windows Vista.
    I'm just trying to make it so I don't have to re-customize everything I already have done by doing a fresh installation of Firefox.
    Or can I just save the existing Mozilla Firefox program folder and then drag and drop it into the new programs folder in Windows 7?
    Thanks,
    numetro

    A couple of links that can help with this, [[Backing up your information]] and [http://kb.mozillazine.org/Profile_backup Profile backup - MozillaZine Knowledge Base]. The second one includes a link to a free utility that can make this easier.
    Just saving the progams folder will not work, the user data is stored elsewhere.

  • JavaScript To Save A File In Adobe 8?

    Can anyone show me a sample JavaScript to save a file in Adobe 8?
    I tried using "Execute a menu item
    File>Save"
    but it doesn't seem to work in adobe 8.

    Adobe does not consider this a 'safe' menu item and has removed from the list of menu items that can be executed. There is more information available in Acrobat JS API Reference.

  • [SOLVED] Cannot save things in Firefox

    This is probably one of the wierdest problems that I've seen.
    For whatever reason, I am unable to open a save dialog in Firefox. I can't save images, web pages, etc...
    However, I've noticed that when I try to open a save dialog and then switch to vc/1 (output of Xorg) I notice that the word "None" is displayed.
    As always, any help is greatly appreciated...
    Last edited by ZeroTruths (2009-07-29 15:43:25)

    djszapi wrote:
    Hello ZeroTruths!
    IIt's a general/joker solution
    What does that mean?:P I now that creating a new profile is not a solution.....but, hey, its only browser:cool::/

  • When I try to save an image firefox is automatically removing any image filetype (.jpg .png .bmp etc) and replacing it with .html

    Every time I try to save an image by right clicking and going save image as firefox is changing the filetype to .html
    It does it for every website and every image regardless of its file type. Even if you go to the direct link for the image and try to save it, it will save it as "image.htm" rather than "image.jpg" as it shows the file to be in the address bar.

    Try the Firefox SafeMode. <br />
    ''A troubleshooting mode, which disables most Add-ons.'' <br />
    ''(If you're not using it, switch to the Default Theme.)''
    # You can open the Firefox 4/5/6/7 SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut.
    # Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shft key) to open it again.''
    If it is good in the Firefox SafeMode, your problem is probably caused by an extension, and you need to figure out which one. <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes

  • Every time I want to save something in firefox, the suggested filename is automatically copied however I don't want this

    Every time I want to save something in firefox, the suggested filename in the requester is automatically copied. This overwrites what I have in the copy buffer, which is often what I have previously selected to use as the filename or part thereof for what I want to save.
    I want to prevent this, so that I can use the filename that I want without having to type it manually, or store it somewhere else then have to copy it again to recover it.
    How do I stop this behaviour in firefox, as it is extremely annoying.

    If you are also getting a message to contact iTunes support then you can do so via this page : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • I want to save passwords in firefox (that's ok, I know how it works), BUT i don't want to fill automaticly when I type my username on a site.

    I want to save passwords in firefox (that's ok, I know how it works), BUT i don't want to fill automaticly when I type my username on a site.

    Dear Icom
    plese try to update your Firefox Client the latest version.

  • I selected save password; but firefox does not have it in the list of saved passwords??

    I selected save password; but Firefox does not have it in the list of saved passwords??

    Firefox will only remember a password if you click the Remember button on the sliding bar at the top that opens when Firefox detects a password.<br />
    If you mean a check box on a web page to remember you then such a choice is stored in a cookie on your computer.
    * Websites remembering you and automatically log you in is stored in a cookie.
    * Create an allow cookie exception (Tools > Options > Privacy > Cookies: Exceptions) to keep such a cookie, especially for secure websites and if cookies expire when Firefox is closed.
    * In [[Private Browsing]] mode all cookies are session cookies that expire if that session is ended, so websites won't remember you.
    * Do not use [[Clear Recent History]] to clear the "Cookies" and the "Site Preferences"
    Clearing "Site Preferences" clears all cookies, images, pop-up windows, software installation, and password exceptions.
    See:
    * [[Cookies]]
    * [[Enabling and disabling cookies]]
    * [[Remembering passwords]]

  • My saved e-mails can't be retrieved without Javascript, and my copy of Firefox hasn't got it. How do I obtain it safely?

    Javascript is not on my Firefox.

    JavaScript is built-in to Firefox and turned on by default. If yours is disabled, numerous websites will warn you about it. If this problem only occurs on one site, there probably is something else going on, whether it's a conflict with an add-on, or a missing plugin, or some other issue.
    Could you describe the problem with saved emails in more detail? Are these archived on your regular email site, or are they saved on your hard drive, etc.?
    In case one of your extensions is involved, could you test in Firefox's Safe Mode? That's a standard diagnostic tool to deactivate extensions and some advanced features of Firefox. More info: [[Troubleshoot Firefox issues using Safe Mode]].
    You can restart Firefox in Safe Mode using either:
    * "3-bar" menu button > "?" button > Restart with Add-ons Disabled
    * Help menu > Restart with Add-ons Disabled
    Not all add-ons are disabled: Flash and other plugins still run
    After Firefox shuts down, a small dialog should appear. Click "Start in Safe Mode" (''not'' Reset).
    Any difference?
    By the way, there is also a Java plugin, no relation to JavaScript despite the name, which some sites might require. For more information about Java, see this page: http://java.com/en/download/installed.jsp - note: when installing, watch out for the Ask toolbar and uncheck those boxes.

  • Downloaded JavaScript update w/o closing Firefox. OK?

    I downloaded the latest JavaScript update w/o closing Firefox or Photoshop CS3. OK? If not, what do I do?
    == This happened ==
    Just once or twice
    == This morning

    Hi,
    You can try to manually download the updated version and install: https://www.mozilla.org/en-US/firefox/new/

  • Using Javascript form validation in WordPress - Firefox issues

    I have been struggling for a while to get javascript to validate a WordPress based HTML form which uses radio buttons. I finally came up with a solution with was a bit long-winded but worked - at least in IE and Chrome - however, it doesn't work in Firefox (which suggests my code is a bit sloppy). I think my radio button reference is the issue. Can anyone help with what I have done wrong - apart from use an inefficient approach for validation :-)?
    A simplified version of my form:
    <script>
    function validateForm()
    var aa=document.forms["personalise"]["motivation"]["1a"];
    var ab=document.forms["personalise"]["motivation"]["1b"];
    var ac=document.forms["personalise"]["motivation"]["1c"];
    var ad=document.forms["personalise"]["motivation"]["1d"];
    var ae=document.forms["personalise"]["motivation"]["1e"];
    if (!(aa.checked == true || ab.checked == true || ac.checked == true || ad.checked == true || ae.checked == true))
    alert("Question 1 must be completed");
    return false;
    </script>
    <form name="personalise" action="insertdatatest.php" onsubmit="return validateForm()" method="post">
    1. Are you seriously planning to quit </b>:&nbsp;&nbsp;
    <input id="1a" type="Radio" title="" name="motivation" value="1" /> Within the next 2 weeks
    <input id="1b" type="Radio" title="" name="motivation" value="2" /> Within the next 30 days
    <input id="1c" type="Radio" title="" name="motivation" value="3" /> Within the next 3 months
    <input id="1d" type="Radio" title="" name="motivation" value="4" /> No, I am not currently planning to quit
    <input id="1e" type="Radio" title="" name="motivation" value="5" /> I have already quit
    <input type="submit" value = "Submit">
    </form>
    For My Website : http://www.schoolanduniversity.com

    Thanks for your support,
    This will partly solve the issue I think. Now, the validation is indeed only done for the first form. But I need to save data twice when entering data in the second grid. When checking the error console in mozilla I see following error:
    Error: grid[r] is undefined
    Which is reffering to:
              if ((grid[r] [1] != missing) ||(grid[r][2] != missing) || (grid[r][3] != missing))
    When I save again, the data will be saved without this error.
    Is there a way to exclude the second grid in the if Statement?
    Regards,
    Erik

  • Acrobat JavaScript Doc.SaveAs using "CHTTP", SSL, and PKI Authentication

    I'd like to load a client PKI certifricate into a Doc.SaveAs() SSL URL.  IE and Firefox do this fairly easily.  How can Acrobat do it?
    Thanks for reading.

    HI, Irosenth,
    from the API document, it does say
    saveAs
    5.0
    S
    S
    Saves the file to the device-independent path specified by the required parameter, cPath. The file is not saved optimized for the web. Beginning with Acrobat 6.0, the document can be converted to another file type (other than PDF) and saved as specified by the value of the cConvID parameter.
    Note: This method can only be executed during a batch or console event. See Privileged versus non-privileged context for details. The event object contains a discussion of JavaScript events.
    (Adobe Reader S): This method is available in Adobe Reader for documents that have Save usage rights.
    What does the underlined sentence mean? does it mean it should work on reader as well?

  • Just had Javascript update done and now Firefox won't open,,,keeps coming up with XML Parsing error not well formed. how can I get rid of this?

    also awindow pops up NS error XPC Bad convert JS cannot convert JAVASCRIPT argument arg 4 (NSL window watcher open window)
    == This happened ==
    Every time Firefox opened
    == just today ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; (R1 1.5))

    There's a lot there, so I'll start with the parts I can answer quickly.
    The "ACL found but not expected..." messages can be safely ignored, so says this article
    http://docs.info.apple.com/article.html?artnum=306925
    (look below all the "SUID" examples)
    I had changed my Desktop image earlier but when the "Installing 1 item" window came up it changed back to the back ground that you first see on your desktop after installation.
    Leopard installs updates a bit differently. If it's simply an application that does not change system files, it installs them like before, without having to restart. If the update is to the system, then you must immediately "restart," It then goes to that stars and purple screen to perform the installation. Before, it would do the installation while you still had control of the Mac and would prompt you to restart when it finished the installation. This change probably make things more secure and reliable, because you aren't allowed to do other things on the Mac while system updates are being installed.
    Please post back with the remaining point of concern.

  • Using javascript to save a pdf to a different directory and generating a new filename based on form fields in the document.

    I have built the following script in an attempt to create a submit button that will automatically save the document in a different directory on my computer. It will also use the form field data "customer" and "date" to generate the filename. I printed out the variable myPath and it looks like it printed the correct string. I keep getting the following error:
    TypeError: redeclaration of const path
    any help would be much appreciated.
    var customer = this.getField("Customer").value;
    var date = this.getField("Date").value;
    var path = "C:/Users/awilliams/My Documents/Test/"
      var reg = date.match(/(\d+)\/(\d+)\/(\d+)/);
    var myPath= "C:/Users/awilliams/My Documents/Test/" + customer + "_" + reg[1] + "." + reg[2] + "." +
    reg[3] + ".pdf";
    this.saveAs(myPath);

    "path" is a keyword within a PDF you should not use keywords as a name for any other object as a general rule.
    Have you checked the PDF Reference to see how to create a file path name within a PDF,  3.10.1 File Specification Strings page 118?
    Did you carefully read the Acrobat JavaScript Reference for the saveAs method?
    The notes following the description:
    Note: This method can only be executed during a batch or console event. See Privileged versus non-privileged context for details. The event object contains a discussion of JavaScript events.
    (Adobe Reader S): This method is available in Adobe Reader for documents that have Save usage rights.
    How to Save a PDF with Acrobat JavaScript

  • I'm using Firefox version 3.6 on my '02 Mac G4. When I installed it, it worked fine, But then all of a sudden the "save" and "save as" windows stopped coming up at all when I selected "save" anywhere in Firefox. What happened and how do I fix it?

    I downloaded and installed Firefox on my '02 Mac G4. It worked great. Now I have version 3.6. But my weird problem is one day when I ran it, the "save" and "save as" windows stopped popping up at all. I'd left click a picture and select "save as" and nothing would happen. I'd go to the menu and select "save" and still no window would pop up. It would just act as if nothing had been clicked. No loading icon or anything and no "save as" window. I've never been able to get it to work. The volunteer in the live support chat typed "That IS weird.." I tried his suggestion but it did nothing. I may have deleted the plist preferences file in the preferences library folder to get it started again after a freeze up threw it out of whack but I've never had this happen before.And i've tried doing that again to see if that would restore it. But the plist always regenerates itself and the "save as " window still never appears when I run Firefox. The "save" window works just fine in every other program on my Mac, but not in Firefox. Weird..

    Leliforever, cheek you list of installed add-ons, the Ask toolbar can be installed without the users knowledge.
    For checking other extensions that may cause this, follow the procedure in this link - https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for

  • Updated to Lion and now iTunes and Apple TV 2 no longer work

    I "upgraded" to Lion today and now iTunes won't work and neither will my Apple TV 2. I click on media in iTunes and nothing happens. More than that, though, there's something strange going on with the metadata because movie posters are vanishing and

  • Linked library in /usr/lib

    While upgrading I noticed that a statically linked library doesn't show up in /usr/lib. This is what is supposed to happen: install -Dm644 libdds.a "${pkgdir}/usr/lib/libdds.a" The libdds.a is in ${srcdir}. Another file is correctly moved to ${pkgdir

  • Purchase Order  field in FBL1N not displaying data

    Dear All:                   I have fetched EBELN field from BSEG in FBL1N as a special field. There are thousands of invoices against vendors posted with through PO but whenever i fetch PO field in layout it displays no result. I am unable to underst

  • Tracking of points

    Hello everyone, is there any "standard" algorithm for tracking a lower number of points (i.e. ~ 5 ) in a sequence of frames? At the current point, I'm able to analyse a video stream and search for the center points of circles. Now i have to determine

  • Where is wi-fi on ios6 in Russia??????????????????????

    The IPhone sees Wi-fi, but nothing loads ... What is going on???? OPENED the Internet with YOUR LAPTOP, and THERE on the SUBJECT MORE THAN 600 NEWS from Russia! What is going on? You're doing this on purpose, iphone5 bought property Council??? IT IS