Get to Other Bookmarks in Firefox using NirCmd?

December 28, 2017 at 12:30:06
Specs: Windows 10, CPU: Intel Core i7 6700 @ 3.40GHz, Skylake 14nm Technology . . . RAM: 16.0GB Dual-Channel Unknown @ 1064MHz (15-15-15-36)
In Firefox, Ctrl+Shift+B gets you to "Other Bookmarks"

I would like to make a button in Excel, that runs a .BAT file, that uses NirCmd to get there (I have it figured out using VBA).

The best I can do is . . . if I run this code manually, as two separate .BAT files, one after the other, it goes to "Other Bookmarks":

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

"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

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

I was wondering:

1.) Why doesn't it work when I put it all into one .BAT file? . . . What computer function is being overlooked?

2.) Why doesn't it work, even if I put "SLEEP 2" for DOS, or "wait 2000" for NirCmd, between opening the "Library" and sending the keys?

I think the answer is to use CALL (but what I did just hangs), or Calling a Subroutine . . . but now I'm lost:

USING A .BAT FILE
CALL - Call one batch program from another, or call a subroutine . . . https://ss64.com/nt/call.html

USING VBA FROM EXCEL?
Calling Sub and Function Procedures . . . https://msdn.microsoft.com/en-us/vb...

Any ideas? Thx


See More: Get to Other Bookmarks in Firefox using NirCmd?

Reply ↓  Report •

#1
December 28, 2017 at 13:53:15
It looks like the parameter "focus" is not necessary at the end of this line, it works without it:

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" win activate title "Library" focus

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" win activate title "Library"

message edited by mb1280


Reply ↓  Report •

#2
December 28, 2017 at 21:43:36
REM TWO OF THESE, ONE OPENS, AND IT DOES NOT GO TO "OTHER BOOKMARKS"
REM "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome chrome://browser/content/places/places.xul
REM "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome chrome://browser/content/places/places.xul

REM TWO OF THESE, TWO OPEN, AND NEITHER GOES TO "OTHER BOOKMARKS"
REM START "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome "chrome://browser/content/places/places.xul"
REM START "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome "chrome://browser/content/places/places.xul"

REM TWO OF THESE, TWO OPEN, AND ONE OPENS TO "OTHER BOOKMARKS" ... I HAVE LOOKED IN TASK MANAGER, IT LOOKS LIKE FIREFOX.EXE MUST BE OPEN
"C:\Program Files (x86)\NIRCMD\nircmdc.exe" exec show "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome "chrome://browser/content/places/places.xul"
"C:\Program Files (x86)\NIRCMD\nircmdc.exe" exec show "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"
"C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey pagedown down
"C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey enter press


Reply ↓  Report •

#3
December 31, 2017 at 07:36:47
I neglected to put in the "key up action" for my sendkeys . . . the above worked, but correct coding is as follows:

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

NirCmd Command Reference - sendkey . . . http://nircmd.nirsoft.net/sendkey.html

sendkey [Key] [press | down | up]

The second parameter specifies the key action: 'press', 'down', or 'up'. For each key down action, you should also add the appropriate key up action.

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

"C:\Program Files (x86)\NIRCMD\nircmdc.exe" exec show "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome "chrome://browser/content/places/places.xul"
"C:\Program Files (x86)\NIRCMD\nircmdc.exe" exec show "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"

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

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

Why can't I just open one Library skin, and have this work?

It works if I have two .BAT files and run them separately. The first one opens the skin. The second one does the sendkeys.

It's something to do with DOS.

Is there some command that can go in between opening the skin, and doing the sendkeys?


Reply ↓  Report •

Related Solutions

#4
January 8, 2018 at 12:27:18
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.

https://drive.google.com/open?id=1e...


Reply ↓  Report •

Ask Question