Sign in to follow this  
Followers 0
00pontiac

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

7 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

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

Edited by 00pontiac

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

you know I thought that the PID probly WOULD change, but it stayed the same all nite that I was working on this. why I started using it was largely due to inexperience.

so thanks for clearing that up to

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0