Computer Hope

Software => Computer software => Topic started by: slack7639 on January 05, 2018, 02:45:10 PM

Title: NirCmd - Weird behavior, if there's nothing in "Other Bookmarks"
Post by: slack7639 on January 05, 2018, 02:45:10 PM
This is a macro I have in Excel, that runs a .bat file (included in the remarks).

Any idea why, if there isn't at least one bookmark in Firefox's "Other Bookmarks," then NirCmd's "activate ititle" reduces, and re-positions, a perfectly fine, maximized Firefox browser window to 1/8 its size?

. . . wait, now it's not doing it . . . how do you figure out what's going on when it does that?

That Dim issue is another question.

' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Sub Library_open_Nir_CSB(control As IRibbonControl)

' After being appended, delete the bookmarks from "Other Bookmarks" using - NirCmd / Ctrl + Shift + B

' In order for this to work, one of these two must be already open, in order to access something:
' 1.) the Firefox browser . . . "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
' 2.) the Library "skin" . . . "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -chrome chrome://browser/content/places/places.xul
' The browser will probably be open, since we're working on the Bookmarks, so this is just something to be aware of.

' Weird behavior, if there's nothing in "Other Bookmarks"
' wait 250 . . . with this value, it puts the main browser into a small window, in the top left 1/8 of the screen . . . change it to:
' wait 500 . . . do a Restart, same thing . . . change it to:
' wait 750 . . . it opens up the folder containing the .bat file
' if I put a bookmark in "Other Bookmarks," then it starts working again
' . . . this isn't an issue when NirCmd opens the Library "skin" directly, and does Pagedown / Enter
' . . . if there's nothing in "Other bookmarks," why isn't 250 milliseconds enough time for the browser window?
' . . . how does having at least one bookmark in there make it work?
' if I put a "wait 250" after each sendkey, then it doesn't do this, but it's also a lot slower
' if I divide up 250 by 7, and "wait 35" after each command?  no, doesn't work
' if I add a "wait 250" between CSB "down" and "up"?  no, doesn't work
' it's only consistently good with the firefox browser window, if there's one or more bookmarks in "Other Bookmarks"
' . . . wait, now it's not doing it . . . how do you figure out what's going on when it does that?

' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

' @ECHO OFF

' "C:\Program Files (x86)\NIRCMD\nircmdc.exe" win activate ititle firefox
' "C:\Program Files (x86)\NIRCMD\nircmdc.exe" wait 250

' "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey ctrl down
' "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey shift down
' "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey b down

' "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey ctrl up
' "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey shift up
' "C:\Program Files (x86)\NIRCMD\nircmdc.exe" sendkey b up

' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

' If I Dim this as "NIR_CSB", it just opens the folder containing the .bat file [?]

' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Dim NIR_CSB_1 As String
    NIR_CSB_1 = "C:\My Documents\SQLite3\BAT files\Library open Nir CSB.bat"
    Call Shell(NIR_CSB_1, vbNormalFocus)

End Sub
Title: Re: NirCmd - Weird behavior, if there's nothing in "Other Bookmarks"
Post by: patio on January 05, 2018, 05:52:06 PM
You keep starting new Topics...assuming others have read your other Topics and know what the issue is...

Title: Re: NirCmd - Weird behavior, if there's nothing in "Other Bookmarks"
Post by: slack7639 on January 06, 2018, 08:59:06 AM
I figured out the other ones, and will post the fix.  This is a new issue - weird behavior of NirCmd
Title: Re: NirCmd - Weird behavior, if there's nothing in "Other Bookmarks"
Post by: patio on January 06, 2018, 09:10:31 AM
Fair enuff...