Sign in to follow this  
Followers 0
splatz

ObjDestroy command? Opposite of ObjCreate

6 posts in this topic

Hi all,

I have a script that creates a COM connection to iTunes, using the following command:

$iTunesApp = ObjCreate("iTunes.Application")

It works great. The problem I am having is when I attempt to quit iTunes, the autoit script does not disconnect itself, and iTunes pops up a warning. I would like to know if there is a command I can call within autoit to either disconnect the object from iTunes, or destroy the object completely.

Thanks,

Splat

Share this post


Link to post
Share on other sites



You should be able to do this by setting the object variable to 0 or a null string ("").

$iTunesApp = 0

Dale

Hi all,

I have a script that creates a COM connection to iTunes, using the following command:

$iTunesApp = ObjCreate("iTunes.Application")

It works great. The problem I am having is when I attempt to quit iTunes, the autoit script does not disconnect itself, and iTunes pops up a warning. I would like to know if there is a command I can call within autoit to either disconnect the object from iTunes, or destroy the object completely.

Thanks,

Splat


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Hi, and thanks for the reply. Unfortunately, setting the object variable to null does not destroy the actual object. iTunes still believes that autoit is connected to it. I know there must be some way, because if I ask autoit to terminate itself when iTunes quits, i don't receive an error. This means that autoit performs some disconnect command when quitting. Any ideas would be appreciated!

-Splat

You should be able to do this by setting the object variable to 0 or a null string ("").

$iTunesApp = 0

Dale

Share this post


Link to post
Share on other sites

Maybe try this:

$iTunesApp.Close

We have enough youth. How about a fountain of SMART?

Share this post


Link to post
Share on other sites

Maybe try this:

$iTunesApp.Close
Unfortunately, that didn't work either. That command is trying to ask the object to do something. What I'm looking for is a command to tell autoit to disconnect the given object. Thanks for the guesses tho!

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