2 posts in this topic
I am having a very unique, but repeatable problem with ImageMagick COM interface. Here are the applicable lines of code:
and then later on...
the array points to a pdf file with the "convert" command converting the first page of the pdf to a jpg with any alpha layer removed.
Every time, without fail, the first time I run the script on a freshly booted machine it crashes on the $oIM.Convert command. It does this if it isn't compiled and says there is an error executing the command on the object. If compiled, i get an error that autoit has stopped responding. Anytime I run the script, compiled or not, after this initial crash everything works perfectly fine.
I am totally at a loss as to why this is occurring and how to correct it.
Is there a way to read data directly from the Windows Component Object Model (COM) interface?
I am trying to make a really simple disk space reporter tool for accounts on an Active Directory domain, to read the disk quota limit for the logged on user's home directory, and report how much disk space they are currently using.
MSDN: IDiskQuotaUser interface
I've coded the small script below, but it can't seem to get the instance of Windows Media player as it keeps going to @error, I've not used com objects before so any assistance would be appreciate. I already have WMP open and minimised. I retrieved "WMPlayerApp" from the AutoIT info tool, I've included a copy below.
I'm using these sources:
$oWMP = ObjGet("", "WMPlayerApp") If @error Then MsgBox(0, "Can't get WMP", "Couldn't connect to the WMP instance") Exit EndIf $wmpPlayState = $oWMP.playState MsgBox(0, "Play State", $wmpPlayState) $wmpSongName = $oWMP.currentMedia.name MsgBox(0, "Play State", $wmpSongName) I've also seen references to the below, but I want to get an existing open WMP:
ObjCreate("wmplayer.OCX") and have looked at the WMP.udf but can't see how it will do either of the functions I've coded above.
Hi all (Especially @water)
I wonder how to do this task in word from autoit.
Assume that i pasted some text into word with this code.
Local $oWord = ObjGet("","Word.Application") Local $wRangeObj = _Word_DocRangeSet($oWord, 0) Local $data = ClipGet() $wRangeObj.Text = $data $wRangeObj.Font.Bold = True So far so good. Now, i need to enter a new line in word and turn the Font.Bold = False.
Currently, i did it with activating the word window and Send() function. But i would like to do it with the help of COM object. How can i do that ?
Hello, I found a VB snippet which I would love to use in AutoIt
strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_Process") For Each objItem in colItems Wscript.Echo objItem.Name Wscript.Echo objItem.CommandLine Next Despite my best efforts, I am not able to understand a thing from that piece of code . All I know is that it outputs the Name and Commandline of all the processes currently running (Let's see if I am right).
Can anyone help me with convert this into AutoIt? Thanks in Advance!