Firefox 57 ignores NirCmd


  1. Posts : 81
    Windows 10 Pro 64-bit
       #1

    NirCmd requires you to click the .BAT file twice?


    I'm using the current version, Firefox 57.0.2

    I want to use a macro in Excel 2010, that runs a .BAT file with NirCmd, that goes to "Other Bookmarks" in Firefox . . . but I can't figure out how to get it to work.

    The closest I can get is, I open this "skin" / "chrome", which default opens to "All Bookmarks" . . . "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome chrome://browser/content/places/places.xul

    But, what I want is, which can only be done from within Firefox . . . I use this Keyboard Shortcut, and it default opens to "Other Bookmarks" . . . CTRL + Shift + B

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    I've tried many things with no luck (switches, VBA, AutoHotkey) . . . but I think this would be the simplest, with NirCmd:

    nircmd.exe and nircmdc.exe are the same, except that in the console version, all error messages go to the console window, instead of using a message box.

    Below are the commands I have tried in the .BAT file . . . separate, and then combined, to see if it will do anything . . . It seems like they should work - places.xul has the focus - but Firefox ignores what NirCmd has. Any idea what's going on?

    With "places.xul" open, and having the focus, you just have to manually hit enter, or page down and enter, to see it do something.

    I've been looking at this page to get the commands . . . http://www.nirsoft.net/utils/nircmd2.html

    If Pagedown + Enter were sent, that should get me there.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome chrome://browser/content/places/places.xul

    "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey pagedown

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome chrome://browser/content/places/places.xul

    "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey enter

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome chrome://browser/content/places/places.xul

    "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey pagedown+enter

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Last edited by mb1280; 28 Dec 2017 at 10:57.
      My Computer


  2. Posts : 1,020
    Windows 10 Pro 20H2 19042.572
       #2

    I don't have an answer to your problem, but this post should be in the "Browsers" section, since it more related to FireFox than general software. Maybe one of the Mods here will move it. If they don't, then I would open a similar post in that section.
      My Computers


  3. Posts : 81
    Windows 10 Pro 64-bit
    Thread Starter
       #3

    Ok, I'm getting results now, but have a bug - you have to click the .BAT file twice for it to work. Why?

    Here is the code for the .BAT FILE

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome chrome://browser/content/places/places.xul

    REM Sleep - fixed delay - Windows CMD - SS64.com
    REM SLEEP 2

    REM NirCmd Command Reference - wait
    REM "C:\Program Files (x86)\NIRCMD\nircmdc.exe" wait 2000

    REM NirCmd Command Reference - sendkey
    REM I click the .BAT file once, "places.xul" loads, and the DOS window hangs
    REM I click the .BAT file again, "places.xul" loads, it goes to "Other Bookmarks," as follows, and Exits
    REM Results of the first instance have to be left open for this to work
    REM Why can't it get this on the first try?
    REM If I pause it for 2 seconds, either way above, that doesn't help, it's the same thing
    REM "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey down press
    REM "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey down press
    REM "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey enter press

    REM Combined - Neither of these work, it looks like this has to be three separate commands:
    REM "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey down press down press enter press
    REM "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey down press sendkey down press sendkey enter press

    REM This works, the same buggy way as above
    "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey pagedown down
    "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey enter press

    REM Do I need "EXIT" here? It works without it:
    REM EXIT
      My Computer


  4. Posts : 81
    Windows 10 Pro 64-bit
    Thread Starter
       #4

    So, I'm getting closer . . . It works if I run this code manually, as two separate .BAT files, one after the other:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome chrome://browser/content/places/places.xul

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    "C:\Program Files (x86)\NIRCMD\nircmdc.exe" win activate title "Library" focus
    "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey pagedown down
    "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey enter press

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    . . . any idea how you get it to work using CALL, or Calling a Subroutine? I think this is the answer:

    USING A .BAT FILE
    CALL - Call one batch program from another, or call a subroutine . . . Call - Windows CMD - SS64.com

    USING VBA FROM EXCEL?
    Calling Sub and Function Procedures . . . Calling Sub and Function Procedures
      My Computer


  5. Posts : 81
    Windows 10 Pro 64-bit
    Thread Starter
       #5

    Here's what I figured out. There's too much to put here, so, I've put it on a 4-page PDF on my Google Docs:

    4 Ways to get to Firefox "Other Bookmarks", from slowest to fastest
    The following are 4 macros that I have in Excel 2010.
    The first two just use VBA.
    The second two use NirCmd.

    Other Bookmarks.pdf - Google Drive
      My Computer


  6. Posts : 1,513
    X
       #6

    I'm not sure what are your complete requirements ...
    It seems you want to delete a Firefox bookmark, and you want to issue the command to do so from within an Excel spreadsheet (using VBA).

    I'll accept the latter part (Excel), and approach the problem differently ...

    Firefox keeps bookmarks and lots of other configuration data in various sqlite database files.
    So I would massage the bookmark(s) by executing a simple query against the bookmark database.
    You can use Python to access the bookmarks database. But I prefer the sqlite.exe console app.

    This is easy ... and it doesn't use the Firefox GUI to carry out the changes.

    BTW ... I do this all the time to fetch and/or delete cookies from the cookies sqlite database file.
      My Computer


  7. Posts : 81
    Windows 10 Pro 64-bit
    Thread Starter
       #7

    . . . seems you want to delete a Firefox bookmark, and you want to issue the command to do so from within an Excel spreadsheet (using VBA)

    Yes

    . . . execute a simple query against the bookmark database . . . But I prefer the sqlite.exe console app

    Yes

    . . . This is easy

    Yes, if you know the code for it, LOL

    . . . and it doesn't use the Firefox GUI to carry out the changes.

    Cool!

    . . . BTW ... I do this all the time to fetch and/or delete cookies from the cookies sqlite database file.

    Excellent!

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    I was using SQLite Manager to get my Bookmarks out of Firefox, but it quit working with FF57:

    SQLite Manager 0.8.3.1-signed.1-signed :: Add-ons for Firefox . . . https://addons.mozilla.org/en-US/fir...qlite-manager/

    I then found this as a replacement:

    DB Browser for SQLite . . . I got the "PortableApp" version . . . DB Browser for SQLite

    . . . but then got the notion to automate the whole process:

    bookmarks-to-CSV.pdf . . . [A pdf I have made, and uploaded to my Google Docs] . . . This first page provides all you need to know, to get your Bookmarks into a .CSV file (This won't do anything to your actual Bookmarks, it just extracts a copy of them.) . . . Then, the next few pages provide the details of what's going on . . . bookmarks-to-CSV.pdf - Google Drive

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    So, "DB Browser for SQLite" lets me see all the fields in places.sqlite, but, questions I have are . . .

    1.) What would be the delete query for "Other Bookmarks" in SQLite3? I don't even see the "Other Bookmarks" folder.

    2.) If someone wanted to convert from having their Bookmarks in Firefox, to Excel, what fields would they need to add, in order to get their folders and sub-folders (the query I have in the above PDF just extracts the ID, Title, URL, and Date Added)

    3.) What's the query you use to see your cookies? How do you delete them them through SQLite3? Is it better than using CCleaner for some reason?
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 04:59.
Find Us




Windows 10 Forums