Jump to content

Recommended Posts

Posted

Amazing! :unsure:

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted (edited)

  On 5/14/2011 at 4:54 PM, 'czardas said:

If this is capable of what I think it's capable of, then: Way Hey! :unsure:

This reminds me on one episode of Malcolm in the Middle when he's babysitting this old lady with broken arm. She falls asleep at some point and he invites his geeks over knowing she'll be sleeping for few hours. One "tough" geek says something like: "Do you guys think what I think?", they all go "Yeahhhh!!!".

...If you ever see me laughing with no reason, it's probably because I remembered the next scene from that episode. OMG hilarious! :> It's completely above me. Needless to say, they didn't think what he thought.

I've added c# example. First post.

Edited by trancexx

♡♡♡

.

eMyvnE

Posted

  On 5/14/2011 at 10:09 PM, 'Manadar said:

CoGetObject. :unsure:

The code is beautiful.

Could be reduced to:

object myAu3Object = Marshal.BindToMoniker("AutoIt.Application");
;...
Would that be more correct?

♡♡♡

.

eMyvnE

Posted

  On 5/14/2011 at 9:25 PM, 'trancexx said:

...If you ever see me laughing with no reason, it's probably because I remembered the next scene from that episode. OMG hilarious! :> It's completely above me. Needless to say, they didn't think what he thought.

Hmm unfortunately I'm not familiar with the episode, so I'll have to imagine what the others were thinking. On the other hand, Access AutoIt may do much more than I think it does. Either way I like the examples. :unsure:
Posted

  On 5/14/2011 at 11:49 PM, 'trancexx said:

Could be reduced to:

object myAu3Object = Marshal.BindToMoniker("AutoIt.Application");
;...
Would that be more correct?

Native .NET calls are preferred over WinAPI / external calls for a number of reasons. Even if it's just a wrapper around an external call.
Posted (edited)

@trancexx

This is great !

Now AutoIT has a bi-directional COM approach, which is a new milestone. Very nice implementation indead :unsure:

Here is the Powershell example tested on windows 7 - X64.

# No GetObject in Powershell !! 
# http://technet.microsoft.com/en-us/library/ee176862.aspx
cls

# AutoIT Object instantition
[reflection.assembly]::LoadWithPartialName("'Microsoft.VisualBasic")
$oAutoIt = [Microsoft.VisualBasic.Interaction]::GetObject("AutoIt.Application")
$oAutoItType = $oAutoIt.GetType() 

$im = [reflection.bindingflags]::InvokeMethod
$gp = [reflection.bindingflags]::GetProperty 

$oAutoItType.InvokeMember("Call", $im, $null, $oAutoIt, ("ToolTip", "Some cool text",600, 300))
#$oAutoItType.InvokeMember("Call", $im, $null, $oAutoIt, ("Beep", 500, 700))
$oAutoItType.InvokeMember("Call", $im, $null, $oAutoIt, ("Sleep", "2000"))
$oAutoItType.InvokeMember("Call", $im, $null, $oAutoIt, ("ToolTip", ""))

So the only thing that leaves a black spot on AU3 is that it can't access Powershell or .Net classes.

Ps:

Forgot to mention save this example as .PS1 file and you can run this on any windows 7 OS natively.

Don't need to install any additional software dev. environment.

Rgds,

ptrex

Edited by ptrex
Posted (edited)

@trancexx

This is pretty damn awesome! :unsure:

Here's a Python example

(needs pywin32)

import win32com.client

try:
    oAutoIt = win32com.client.GetObject("AutoIt.Application")
    oAutoIt.Call("Tooltip", "Some cool text")
    oAutoIt.Call("Beep", 500, 700)
    oAutoIt.Call("Sleep", 3000)
    oAutoIt.Call("Tooltip", "")

    if oAutoIt.Call("MsgBox", 4 + 48 + 262144, "?", "Kill Server?") == 6:
        oAutoIt.Quit
except:
    print ("+Ermmm... is server script running?")   #Lets have a green output on this example (SciTE)

Edit: Updated example to work on both Python 2 and 3 (tested on 2.6.5 and 3.2)

Edited by AdmiralAlkex
Posted

50 thumbs up, then some more. You make me wish I had thought of it first every time you post something mate, absolutely fantabulous.

[center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw

Posted

Yes, your COMlet (Autolet?) way works very good.

:unsure:

  Quote

and make a simple (the most basic) COM server that exports almost the whole AutoIt functionality to anyone wanting to use it.

Have you thoughts about WEB server creation like your AutoItServer.au3?

  Quote

So the only thing that leaves a black spot on AU3 is that it can't access Powershell or .Net classes.

You have to build COMlet way (through ROT) from Powershell with help of new AutoIt facility, I think

The point of world view

Posted (edited)

In the scripting language LUA is closed with an error. :unsure:

require("luacom")
oAutoIt = luacom.GetObject("AutoIt.Application")
print(oAutoIt)
Edited by Armin
Posted

  On 5/16/2011 at 1:26 PM, 'Digisoul said:

Excellent work trancexx,

Ii have a one question, can we use this approach for IPC ?

That goes without saying.

Objects have properties.

♡♡♡

.

eMyvnE

Posted (edited)

  On 5/16/2011 at 3:59 PM, 'trancexx said:

That goes without saying.

Objects have properties.

I am new in objects. can you please post a one example.Posted Image

Edited by Digisoul

73 108 111 118 101 65 117 116 111 105 116

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
  • Recently Browsing   0 members

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