Computer Hope

Microsoft => Microsoft DOS => Topic started by: slack7639 on December 31, 2017, 08:44:16 AM

Title: Get to Other Bookmarks in Firefox using NirCmd?
Post by: slack7639 on December 31, 2017, 08:44:16 AM
Hello.  I'm not getting assistance with my question here:

Get to Other Bookmarks in Firefox using NirCmd? . . . https://www.computing.net/answers/office/get-to-other-bookmarks-in-firefox-using-nircmd/21151.html

To summarize, I would like to use NirCmd in a .BAT file to get to "Other Bookmarks" in Firefox, like how you can use Ctrl+Shift+B

It seems like you could run this code, and it would work, but you have to open the "Library" skin twice, in order for it to "work" (you have two "Library" skins 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 down
"C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey pagedown up
"C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey enter up
Title: Re: Get to Other Bookmarks in Firefox using NirCmd?
Post by: Salmon Trout on December 31, 2017, 12:30:05 PM
It works for me with the second "open Firefox" line commented out (or removed). Only one "Library" window open. I have my Nircmd files in a different folder from you, but I don't think that makes any difference.

I am not surprised you got few answers in that other place, since your question is way off-topic, as the forum is for questions about Microsoft Office.

Click image to zoom it.

(https://images2.imgbox.com/f5/62/N0KuK3ah_o.jpg)
Title: Re: Get to Other Bookmarks in Firefox using NirCmd?
Post by: patio on December 31, 2017, 05:46:47 PM
Is that roast beef at the bottom of the pic ? ?...:P
Title: Re: Get to Other Bookmarks in Firefox using NirCmd?
Post by: Salmon Trout on January 01, 2018, 02:07:19 AM
Is that roast beef at the bottom of the pic ? ?...:P

It's part of some girl's dresses in the bottom left of a painting called 'A Tale from the Decameron' by John William Waterhouse (my wallpaper at the the time).

(https://images2.imgbox.com/47/45/7c3d2VZO_o.jpg)
Title: Re: Get to Other Bookmarks in Firefox using NirCmd?
Post by: patio on January 01, 2018, 07:10:38 AM
 ;)
Title: Re: Get to Other Bookmarks in Firefox using NirCmd?
Post by: Salmon Trout on January 01, 2018, 07:47:13 AM
;)
I knew you were being frivolous, but it's such a nice painting, I thought it would liven up the thread a bit, especially since the OP seems to have lost interest.
Title: Re: Get to Other Bookmarks in Firefox using NirCmd?
Post by: patio on January 01, 2018, 08:24:32 AM
It is nice...
Title: Re: Get to Other Bookmarks in Firefox using NirCmd?
Post by: patio on January 01, 2018, 09:08:50 AM
I remember when i had a slideshow of M.C. Esher drawings as my wallpaper....i never got any work done...
Title: Re: Get to Other Bookmarks in Firefox using NirCmd?
Post by: slack7639 on January 02, 2018, 12:01:14 PM
Salmon, can you try that .BAT file . . .

. . . but make sure that neither the Firefox browser, nor a copy of the Library "skin" is open.

I think that what you'll see is that it will open the Library "skin" to "All Bookmarks", but NirCmd won't do anything.

. . . ie. The sendkeys will not "act on" the Library "skin"

From what I'm seeing, NirCmd needs one of the above two "already open" in order for it to be able to work
Title: Re: Get to Other Bookmarks in Firefox using NirCmd?
Post by: Salmon Trout on January 02, 2018, 01:56:10 PM
Hey, you're right. If you only start one nircmd exec show Firefox, the send key stuff does not work, but if you start two, it does work on the second one.

However, if I start two Library windows, then kill the first one, the send keys stuff works on the second one.

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

REM Wait for Firefox to get going
REM You could use a Sleep command here instead if you have sleep.exe
:loop
tasklist /v | find "Library" && goto next
goto loop
:next

REM On my system I needed at least 5 milliseconds of sleep
REM Maybe 10 or 100 would be safer
REM Using the sleep.exe with the -m option
REM In the Windows 2003 Resource Kit Tools
REM https://www.microsoft.com/en-us/download/details.aspx?id=17657
REM sleep -m 10

REM Taskkill will terminate the first window it finds with the title "Library"
REM which will be the first one you started then exit, leaving the second one running
taskkill /FI "WINDOWTITLE eq Library"

"C:\utils\nircmdc.exe" win activate title "Library"
"C:\utils\nircmdc.exe" sendkey pagedown down
"C:\utils\nircmdc.exe" sendkey enter down
"C:\utils\nircmdc.exe" sendkey pagedown up
"C:\utils\nircmdc.exe" sendkey enter up





Title: Re: Get to Other Bookmarks in Firefox using NirCmd?
Post by: slack7639 on January 08, 2018, 01:25:02 PM
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=1eche0L-qHRWVA_yEh0JiL1k5SNK4HpCt