to open an invisible Chrome window at the http://www.facebook.com, and then to display the PID of this process in a Message Box. This failed on two counts:

Instead, a new tab was opened in my existing Chrome window. Running the script with no active Chrome window started a new (visible) Chrome window.

The PID reflected in the MsgBox did not correspond to any Chrome process running, according to both the Windows Task Manage and Chrome's own internal manager.

This appears to be a problem with Chrome itself, as

Run notepad, , Hide, VarPID
MsgBox %VarPID%

runs exactly as expected.

As well as looking in the help files about the Run command, I tried googling various combinations of the words "AutoIt Run hide pid error", but generally that returned either standard help files about the Run command, or references to the UseErrorLevel option. The only useful link I found was the following: http://www.autoitscript.com/forum/index.php?showtopic=87931 , which prompted me to try the following code:

This is still unsatisfactory - not only does the window pop up before being hidden (which would interrupt the game - see explanation below), but the PID is still incorrect according to both task managers.

I'd really appreciate a way to make this work - thanks in advance for any suggestions.

<explanation>

For those who want to know why exactly I'm doing this - there's an application on Facebook called "Steam Achievements", which posts to your Facebook wall when you accomplish certain achievements on Steam games. As yet there's no automatic update facility - you need to click a button on the application's page to make it manually check for new achievements. I'm wanting to write a script which will run in the background (without interrupting a game) and periodically log into Facebook, navigate to the correct page, click the button, and exit Facebook. I had a brief look at the Facebook API to see if there was a way to do it directly (i.e. not via a browser), but it seemed more complicated than using AutoIt.

Share this post

Link to post

Share on other sites

Scubbo 0

Scubbo 0

Thank you for those informative links - I'll take this as a sign that I should try to persevere with the (objectively better) "direct" method of achieving the desired end result without going via a browser. If that fails, I'll try using Firefox or IE to replace Chrome.