From a script (e.g. REXX or BAT) how can I tell if Firefox is up and running?

System: Windows 7 Ultimate x64
I'm trying to open Firefox with multiple tabs open at one time using a program, which reads a configuration file (XML). I discovered when using the "-new-tab" command line parameter, I get one windows for each URL instead of one window with multiple tabs.
I can get it to work IF Firefox is already up and fully running. In other words its frames exist and are visible. If Firefox is only running (say in the tasklist) but not yet visible, the user again gets one window for each URL (e.g. 5 URLs = 5 Firefox windows) instead of 1 window with 5 tabs.
Thus I've been wondering is there a method in Windows or using Firefox to tell from a script (e.g. REXX, BAT, Perl, etc) if Firefox is completely visible and running, so when you a script uses the "-new-tab" parameter the tab appears instead of a window (per URL).

Hello and thank you for your reply,
Now I wish I hadn't "cleaned" up my question to make it easier to read, but instead included examples. In my case, the initial firefox.exe command I used was:
cmd /C start "FFXI Firefox" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -new-tab "http://wiki.ffxiclopedia.org/wiki/Main_Page" -new-tab "http://wiki.ffxiclopedia.org/wiki/Category:Combat_Skills" -new-tab "file:///C:/Users/Bertram Moshier/Programs/FFXI/FFXI_Skill_Caps.html" -new-tab "http://wiki.ffxiclopedia.org/wiki/Skill_Ups:_A_Guide_by_Kyrial" -new-tab "http://www.mithrapride.org/vana_time/" -new-tab "http://wiki.ffxiclopedia.org/wiki/Dragoon" "http://ffxi.somepage.com/mobdb/" -new-tab "http://www.ffxiah.com/item/4558/yagudo-drink" -new-tab "http://greatbigsea.guildlaunch.com/forums/index.php?gid=108403" -new-tab "http://guildwork.com/games/ffxi/shouts"
As you can see in this version I put "-new-tab" in front of each URL and the result, since firefox version 9.0.1 has been:
1) If firefox.exe is fully up and running a tab for each URL opens in one window.
2) If firefox.exe is not fully up and running a window for each URL opens with only one tab.
So, ah, I have been trying the -new-tab method from the start. Recently, I tried removing the -new-tab and it has been working, but I think that is more of a fluke than correctly working, as it goes against the documentation.
As for tell if firefox is up and running, thanks! I've been using the following code, which is similar to yours. What I found, though, is simply having firefox.exe up and running in advance (or starting it) is NOT enough. Like your code, mine, tells if it is running in the Window's tasklist. Yet, my experience, thus far, has been until the firefox window appears, you still get the multiple windows for each "-new-tab" you send. Only if firefox.exe is already FULLY up and running with its windows visible does the "-new-tab" work per the documentation.
Here is the core code I've been using (using REXX) -- this is static code on the URL and not the XML configuration version.
NOTE: I think it is basically the same as your code, but longer . . . . My hope was the code would wait till firefox would be up enough for the "-new-tab" to work, which I find to be between 8 and 15 seconds depending upon the system. Again what I discovered is simply having the tasklist command show firefox.exe running is NOT enough. Well, this is true on my Windows 7 x64 system (Firefox 9.0.1 - 16)
firefox_found = 0
FFXI_Website_Queue = 'FFXI_Website'
rc = rxqueue('delete',FFXI_Website_Queue)
rc = rxqueue('create',FFXI_Website_Queue)
rc = rxqueue('set',FFXI_Website_Queue)
rc = !!Firefox_Exists()
if rc = 0 then do
'cmd /C start /D "C:\Program Files (x86)\Mozilla Firefox\" "FFXI Firefox" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"'
rc = 0
do until rc = 1
rc = !!Firefox_Exists()
call SysSleep(1)
end
end
'cmd /C start "FFXI Firefox" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -new-tab "http://wiki.ffxiclopedia.org/wiki/Main_Page" -new-tab "http://wiki.ffxiclopedia.org/wiki/Category:Combat_Skills" -new-tab "file:///C:/Users/Bertram Moshier/Programs/FFXI/FFXI_Skill_Caps.html" -new-tab "http://wiki.ffxiclopedia.org/wiki/Skill_Ups:_A_Guide_by_Kyrial" -new-tab "http://www.mithrapride.org/vana_time/" -new-tab "http://wiki.ffxiclopedia.org/wiki/Dragoon" -new-tab "http://ffxi.somepage.com/mobdb/" -new-tab "http://www.ffxiah.com/item/4558/yagudo-drink" -new-tab "http://greatbigsea.guildlaunch.com/forums/index.php?gid=108403" -new-tab "http://guildwork.com/games/ffxi/shouts"'
rc = rxqueue('delete',FFXI_Website_Queue)
call !!EOJ 0
/* >>>>>>>>>>>>>>>>>>>> Insert your subroutines here <<<<<<<<<<<<<<<<<<<< */
| |
| Subroutine section |
| |
!!Firefox_Exists:
'tasklist /V /FI "IMAGENAME eq firefox.exe" | RxQueue' FFXI_Website_Queue '/FIFO'
do while queued() <> 0
parse pull Image_Name PID Session_Name Session_Number Memory_Usage Status User_Name CPU_Time Window_Title
if Image_Name = 'firefox.exe' then do
firefox_found = 1
leave
end
end
return firefox_found

Similar Messages

  • Script to find duplicate index and how can we tell if an index is REALLY a duplicate?

    Does any one have script to find duplicate index? and how can we tell if an index is REALLY a duplicate?
    Rahul

    One more written by Itzik Ben-Gan
    The first query finds exact matches. The indexes must have 
    the same key columns in the same order, and the same included columns but in any order. 
    These indexes are sure targets for elimination. The only caution would be to check for index hints. 
    -- exact duplicates
    with indexcols as
    select object_id as id, index_id as indid, name,
    (select case keyno when 0 then NULL else colid end as [data()]
    from sys.sysindexkeys as k
    where k.id = i.object_id
    and k.indid = i.index_id
    order by keyno, colid
    for xml path('')) as cols,
    (select case keyno when 0 then colid else NULL end as [data()]
    from sys.sysindexkeys as k
    where k.id = i.object_id
    and k.indid = i.index_id
    order by colid
    for xml path('')) as inc
    from sys.indexes as i
    select
    object_schema_name(c1.id) + '.' + object_name(c1.id) as 'table',
    c1.name as 'index',
    c2.name as 'exactduplicate'
    from indexcols as c1
    join indexcols as c2
    on c1.id = c2.id
    and c1.indid < c2.indid
    and c1.cols = c2.cols
    and c1.inc = c2.inc;
    The second variation of this query finds partial, or duplicate, indexes 
    that share leading key columns, e.g. Ix1(col1, col2, col3) and Ix2(col1, col2) 
    would be considered duplicate indexes. This query only examines key columns and does not consider included columns. 
    These types of indexes are probable dead indexes walking. 
    -- Overlapping indxes
    with indexcols as
    select object_id as id, index_id as indid, name,
    (select case keyno when 0 then NULL else colid end as [data()]
    from sys.sysindexkeys as k
    where k.id = i.object_id
    and k.indid = i.index_id
    order by keyno, colid
    for xml path('')) as cols
    from sys.indexes as i
    select
    object_schema_name(c1.id) + '.' + object_name(c1.id) as 'table',
    c1.name as 'index',
    c2.name as 'partialduplicate'
    from indexcols as c1
    join indexcols as c2
    on c1.id = c2.id
    and c1.indid < c2.indid
    and (c1.cols like c2.cols + '%' 
    or c2.cols like c1.cols + '%') ;
    Be careful when dropping a partial duplicate index if the two indexes differ greatly in width. 
    For example, if Ix1 is a very wide index with 12 columns, and Ix2 is a narrow two-column index 
    that shares the first two columns, you may want to leave Ix2 as a faster, tighter, narrower index.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • I have a new MAC MINI and I want to install a second monitor.  I have one connected to the HDMI and it works.  I can't get a signal to the other one.  It is connected from the thunderbolt to its HDMI port.  How can I make it work?

    I have a new MAC MINI and I want to install a second monitor.  I have one connected to the HDMI and it works.  I can't get a signal to the other one.  It is connected from the thunderbolt to its HDMI port.  How can I make it work?

    Could be a bad cable or bad Thunderbolt port.
    You have 90 days of free telephone support on a new device. You can call them at 1-800-MY-APPLE. Have your Mini's serial number handy
    You can also make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar

  • When I upgraded from v4 to v5 my bookmarks was lost. I do have the one that is in the firefox toolbar. Apparently I had a bookmarks add-on. V5 changed my browser how can I determine what the program was and if the bookmarks are still there?

    When I upgraded from v4 to v5 my bookmarks was lost. I do have the one that is in the firefox toolbar. Apparently I had a bookmarks add-on. V5 changed my browser how can I determine what the program was and if the bookmarks are still there?

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Websites remembering you and automatically log you in is stored in a cookie.
    *Create an allow Cookie Exception to keep such a cookie, especially for secure websites and if cookies expire when Firefox is closed.
    *Tools > Options > Privacy > Cookies: Exceptions
    In case you are using "Clear history when Firefox closes":
    *do not clear Cookies
    *do not clear Site Preferences
    *Tools > Options > Privacy > Firefox will: "Use custom settings for history": [X] "Clear history when Firefox closes" > Settings
    *https://support.mozilla.org/kb/Clear+Recent+History
    Note that clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, and passwords.
    Clearing cookies will remove all specified (selected) cookies including cookies that have an allow exception and cookies from plugins.

  • TS4124 Hi, do you know how can I upload inelegible songs from itunes to Icloud. They are songs added from original CDs. Another question would be how can I transfer all the music I have in my Ipod Classic to my Itunes or ICloud as I want to back it up.

    Hi, do you know how can I upload inelegible songs from itunes to Icloud. They are songs added from original CDs. Another question would be how can I transfer all the music I have in my Ipod Classic to my Itunes or ICloud as I want to back it up.

    Depends on why it's ineligible.  If it's under 96 Kpbs, try right-clicking on the file and choosing Create AAC Version.  (If you don't see this option, go to iTunes>Preferences, click "Import Settings..." then choose "Import Using: AAC Encoder" and "Setting: iTunes Plus".)  Then rescan your library to see if this version will add to iTunes Match.  Or, after changing your import setting, just re-import the song to your iTunes library.
    If the song is over 200 MB you would have to reduce it's size to make it eligible.

  • When I listen to music on Apple TV 2 my pictures from iPhoto come in, but always the same album (which I nevr asked for), always in random order and always in a different format. How can I control what is going on and choose the album myself.

    When I listen to music on Apple TV 2 my pictures from iPhoto come in aafter about ten minutes, but always the same album (which I never asked for), always in random order and always in a different format. How can I choose a different album myself and control the order and format?

    Thank you Winston for a helpful response and for reminding me of something which I found nearly a year ago and then lost (in my mind) because I did not use it. I am grateful for a correct answer but it still only achieves part of what I wanted.
    I can now choose my photos, decide how long they stay on screen and choose one of a variety of presentations. Two things I still can't do.
    One is to get it to play the photos in the chronological order in which I have carefully set them in an album; it still tends to be random and repetitive. The other is that I cannot get any of them them to saty on screen for more than about 20 seconds. I guess this is all due to the way Apple TV is constructed.
    But still thanks, nevertheless.
    Alec

  • HT4865 I just bought this ipad and cannot log out from icloud because i dont have the password.how can i log out from icloud?need help

    I just bought this ipad and cannot log out from icloud because i dont have the password.how can i log out from icloud?need help

    You need to return it to the seller and get your money back.  You cannot reset or use the device with another AppleID installed unless you know the password for that ID.
    If the device has been jailbroken, no one on here can give you any further help...the Terms of Use prohibit us from doing so.

  • How can i know who get my photos and messages from my icloud???

    How can i know who get my photos and messages from my icloud???

    Nobody, except the persons who have your username and password or with whom you share photos streams would be able to see anything from you.

  • How can i know who get my photos and messages from my icloud???, How can i know who get my photos and messages from my icloud???

    How can i know who get my photos and messages from my icloud???

    The following website gives you an overview on how your iCloud data is encrypted: https://support.apple.com/kb/HT4865 So as long as you don not share your Apple ID with someone else, everything should be fine.

  • I have 2 iphones and a macbook on one mobile me account.  How can I keep mail in the macbook and one iphone private from the other iphone?

    I have an iPhone 3G, an iPhone 3GS, and a MacBook on one macmail and mobile me account.  How can I keep mail on the MacBook and iPhone 3 private from the iPhone 3GS?

    Pretty much. I don't understand why you need to worry about MobileMe, though. I'd guess the vast majority of us with iDevices don't have MobileMe accounts at all. That's pretty much why it failed.

  • I saved my photos from my old iphone to my computer.  how can i get them onto my new iphone 6?

    i saved my photos from my old iphone to my computer.  how can i get them onto my new iphone 6?

    iTunes: Syncing photos

  • HT204380 i have a mac book pro and a i-pad 2. both of the devices have the same apple id and same mailing adress. if i want to make a face-time call from my mac book to i-pad 2. how can i do that?

    i have a mac book pro and a i-pad 2. both of the devices have the same apple id and same mailing adress. if i want to make a face-time call from my mac book to i-pad 2. how can i do that?

    You have to add another email address on one of the two devices that you can use as the "You can be reached for FaceTime at" contact address and then remove/uncheck the Apple ID email address as the contact address on that device. The way you are currently setup is like to trying to call yourself on your on phone - from your own phone.
    Using the iPad as the example go to Settings>FaceTime>You can be reached for FaceTime at>Add another email address. Then add a working email address in the next window. Apple will verify the email. Go to the inbox of that email account, read and respond to Apple's email in order to complete the verification process.
    Go back to Settings>FaceTime>Uncheck the Apple ID email address and make sure that the new email address is checked/selected (you will see it being verified again) and that new email address will be your contact address for the iPad.

  • The hotmail address i use for my apple ID was hacked and i no longer have access to it, this is stopping me from accessing any of my icloud or itunes. how can i fix this?

    The hotmail address i use for my apple ID was hacked and i no longer have access to it, this is stopping me from accessing any of my icloud or itunes. how can i fix this?

    Thanks, I appreciate the help.  I think this is one of the problems Apple is creating by changing the OS so often. I had fomer colleagues at [a major aerospace contractor] who told me that so many original files were ultimately lost because of the deadly change in the "Save As" operation that they are now afraid of every OS update. Apple has badly damaged their support base with that very prominent company (they won't update now until they've fully examined and understand changes in the pre-conditioned nature of OS computer functions), and they are a whole lot less enthaled with Mac-related equipment/software. Can't blame them, I too used orginal files that way (as easy-to-use templates), and lost some important files before I realized what was happening (to late to revert). Companies should not have to retrain employees each time an OS gets an update, it's can be very expensive several different ways. They learned a painful lesson with that one. And because I'm now retired and don't use multiple devices, I need iCloud like I need a hole in the head... but I'm told there's no way to keep Apple out of my computer. Fortunately, because of major problems when initially installing Mountain Lion, one hold-over of the hardware/software damage I experienced was that iCloud can no longer access my computer even though everything else is working fine again. That was the only "good luck" I had as a result of that expensive nightmare.

  • HT4914 How can you tell which songs are downloaded from the cloud on an ipad

    How can you tell which songs are downloaded on the iPad from the cloud?

    I know ipad albums are more like tagging photos rather than putting them in folders. I just have a nagging feeling I missed some pics and I have too many to try to go figure out one by one. I don't look at my photos from the camera roll, only from albums I tagged just because I imported photos from different sources and the dates and order is really messed up. I just want to know that I am viewing all the photos from like this vacation or that event and there's none I missed that are only in the camera roll.

  • How can I use a pic from iPhoto as a background for a page, How can I use a pic as a background for a page

    How can I use a pic from iPhoto as a background for a page, How can I use a pic as a background for a page

    cd,
    Insert the picture and position it as you desire
    Make sure the picture is set to Floating in the Wrap Inspector
    Arrange > Send Objects to Background
    Regards,

Maybe you are looking for

  • Reg sending Mail with PDF attachment

    Hi All,           Am converting smartforms(Purchase Order Me23N) to pdf then am attaching pdf in mail,mail is going with attachment to specific id but when i try to open PDF file am getting an Error PDF File is Corrupted. Am using these FM :CONVERT_O

  • Cannot open Adobe Photo Elements 10 on my PC

    I cannot open Adobe Photo Elments 10 software on my PC.  I purchased the software from a local Best Buy retailer about one year ago and registered the product serial number with Adobe.  I also established an Adobe User ID and Password.  I paid for th

  • Short dump in delta extract  using bgRFC in NW 2004s

    Short dump in delta extract after Support Pack install, using bgRFC.  InfoSet Query extractor from Z-table residing on BW system into ODS.  Init and Full loads load successfully, delta loads short dump. "MESSAGE_TYPE_X"         "SAPLARFC" or "LARFCU2

  • Different kernel version between systems

    Hallo. We have a three systems landscape ECC 7.00 kernel 7.00 DEV->TST->PRD Can we upgrade SVI to kernel 7.21_EXT and stay with kernel 7.00 on TES and PRO without problems about transport of object from development to the other systems ? Thanks a lot

  • Lagging of z10 after 10.3.1 update

    While installing update my battery runs out and if got shut down...when I charged it and open it took me to 10.3 .1 boot screen...after opening my phone lags too much...please help!!!!