Jump to content

Script not exiting where I want. Probly an easy one...


Recommended Posts

Trying to create a script that will add a new tab to firefox if it's open. And if it's not open to simply run a new instance.

This is what I have so far

If ProcessExists("1448") Then
   WinActivate("[CLASS:MozillaWindowClass]")
   Send("^t")
   Exit
Else
   Run("C:\Program Files (x86)\Mozilla Firefox\firefox.exe")
EndIf

It's creating my new tabs, in the first three lines. And it's running firefox in the last part. For some reason (I could just be tired) can't get them to work together.

I feel like I should apologise for being a noob, I've done a lot of scripts with autoit (yep! working ones too) but it always takes me forever. been working on this one for longer than I'm willing to admit :) There's a lot more planned with this script, but I hope not to bother again.

Thanks for at least taking a look here!

Edited by 00pontiac
Link to comment
Share on other sites

from getting the process id :) took out of helpfile. that parts works :) lol

Edit : Oh! now it all works! TYVM! missed your code at first. Definitely tired.....

much apreciated

Ahh. okay. But the PID changes every time you close and open again. I've never used this function with PID

Edited by GordonFreeman
Link to comment
Share on other sites

I overlooked Firefox being Minimised, so I figure the last step in this part of my script would be to show the FireFox window in that case....

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

Edit : Removed me being an idiot on a public forum!

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

Was having a simple problem with naming my windows :oops:

my working script :

If ProcessExists("firefox.exe") Then
  WinActivate("[CLASS:MozillaWindowClass]")
  WinSetState("* - Mozilla Firefox", "", @SW_SHOW)
  Send("^t")
  Exit
Else
  Run("C:\Program Files (x86)\Mozilla Firefox\firefox.exe")
EndIf
Edited by 00pontiac
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...