Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Poll: Are you missing OLE support in Autohotkey?


  • Please log in to reply
18 replies to this topic

Poll: Are you missing OLE support in Autohotkey? (30 member(s) have cast votes)

Are you missing OLE support in Autohotkey?

  1. Yes, I'm missing OLE support (18 votes [58.06%])

    Percentage of vote: 58.06%

  2. No, I never needed OLE support (6 votes [19.35%])

    Percentage of vote: 19.35%

  3. No and I even don't know what is OLE. (6 votes [19.35%])

    Percentage of vote: 19.35%

  4. Other reply (1 votes [3.23%])

    Percentage of vote: 3.23%

Vote Guests cannot vote
zorglups
  • Members
  • 25 posts
  • Last active: Mar 07 2012 08:23 AM
  • Joined: 04 Feb 2005
From AHKnow: http://www.autohotke...6&highlight=ole

OLE/COM would allow AutoHotKey to interface more with MS Office applications like Excel, Word, iTune, etc...

Some info on OLE:
http://www4.dogus.ed...vex/axu02fi.htm

------------------------
I love AHK as it helps me to do little magic everyday.
I wouldn't go without it.

I'm personally missing OLE support for a while and do such a job using perl scripts launched from my ahk script.

There are quite a lot of topics in the forums about it.

I introduced this poll to get an idea of how important it is for other AHK users.

Many thanks to Chris for this wonderfull soft.

Pierre.

toralf
  • Moderators
  • 4034 posts
  • Last active: Jul 19 2014 02:32 AM
  • Joined: 31 Jan 2005
I never used OLE before, and I never knew that I'm missing it.

I'm wondering if it would be usefull to automate MS Office applications with OLE. Since to be of use to the normal user it has to be easy. Otherwise most users will not use it and automate MS Office as they did in the past through the GUI.

Due to the complexity of OLE (AFAIK) i doubt that it will be worth in usefullness/development time relation ship.

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
Since AHK can call, say a VBScript or a JScript or another script in WSH (or even something else) that can do Ole in an efficient and tested way, I don't see much the point of Ole integration inside AHK.
Sure, it would expand AHK array of doing things, but I am not sure the object syntax would fit to AHK's syntax.
Beside, I understood that Chris doesn't know much, yet, about Ole/Com/ActiveX, and I know by personal experience that this is a vast knowledge area, hard to learn (I know only general facts about these technologies).
Note that Microsoft tends to obsolete these technologies as soon as people took time to learn them... or at least introduce new complex technologies too often for my taste.
So, beside possible personal interest of Chris in these areas, I think his time would be better used in improving AutoHotkey in areas he already know (and where AHK shines) and where there is still some work to do. I believe the TODO list is already quite impressive...

zorglups
  • Members
  • 25 posts
  • Last active: Mar 07 2012 08:23 AM
  • Joined: 04 Feb 2005
Well, OLE is REALLY easy to use while you have done it once.

In fact you get a kind of dictionary of the OLE enabled application which described the differents objects made available to the user.

Those objects will then have some methods and some properties.

The OLE "dictionary" is VBAOUTL9.chw for Outlook (9 is the version). You can have one for word, excel, ...

Here are some examples to show you how easy it is (this is in VBScript):

Create a new task in outlook using OLE:
Dim objOutlook
Dim itmTask 
Const olTaskItem = 3

' ***  Create Outlook Object and Task Item
' 
    set objOutlook = CreateObject("Outlook.application")
    Set itmTask = objOutlook.CreateItem(olTaskItem)

' ***  Set the task Attributes
'
    itmTask.Subject = "My Task Subject"
    itmTask.DueDate = Date()
    itmTask.save

' ***  Clean up
'
    Set itmTask = Nothing
    set objOutlook = Nothing

Send a mail with outlook using OLE:
' Some declarations
Dim Outlook, NameSpace, newMail
Set Outlook = WScript.CreateObject("Outlook.Application")
Set NameSpace = Outlook.getNamespace("MAPI")
Set newMail = Outlook.CreateItem(olMailItem)

' The interresting stuffs
newMail.Subject = "This is my subject" 
newMail.Body = "This is my mail body" & vbCrLf
newMail.Recipients.Add("recipient@nospam.com")
newMail.Send

' Some cleaning
Set Outlook = Nothing

Those are small and stupid examples. The declaration is the most obscure part when you start with OLE but plenty examples are available in the "dictionaries" and a copy/paste will do the job.

Once you played with it you will find that it is much faster, much more powerful and safer than winactivate+sendkey.

In my company, we have a VoIP (ala Skype) and having OLE in AHK whould allow me to easily answer the phone with assigning a hotkey (preferabily a button of my Logitech MX610 8) ) to trigger the right OLE method.

For sure, it is not only this VoIP but a lot of applications allow this and this makes things easier.

Pierre

zorglups
  • Members
  • 25 posts
  • Last active: Mar 07 2012 08:23 AM
  • Joined: 04 Feb 2005
I agree with PhiLho comment.

I made that poll more by curiousity than to push anything, really.

I will never allow myself to say Chris which way to go.

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
Well, that's easy on the scripter side, which is nice, but I don't know how hard it is to implement this on the program side.
And beside, my point is that stuff like newMail.Recipients.Add("recipient@nospam.com") is hard to fit into AHK existing syntax.

Non-native writer here. Should I write AHK existing syntax (AHK becoming an adjective?) or AHK's existing syntax (possessive, does it works with non-persons?)


Tekl
  • Members
  • 814 posts
  • Last active: May 03 2009 03:28 PM
  • Joined: 24 Sep 2004
Is OLE the same like COM?

JSLover
  • Members
  • 920 posts
  • Last active: Nov 02 2012 09:54 PM
  • Joined: 20 Dec 2004

Should I write...

...I don't know about adjective/possessive...worrying what "part of speech" a word is is annoying...but anyway..."AHK existing syntax" sounds like Chinese people trying to speak English (Chinglish, Engrish.com)...where they miss connecting words..."I can't think example" vs "I can't think of an example"...so anyway..."AHK's existing syntax" sounds better...regardless of what "part of speech" it falls in. School Sucks!

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
Thank you JSLover for enlightening me. I will try and remember this.
I guess I wrote "AHK existing syntax" on the model of "Microsoft Natural Keyboard", althought that is not quite the same thing...

To answer Tekl, I believe that Ole (Object Linking and Embedding) is the successor of DDE for inter-application communication, to allow applications to take a reference or even to integrate objects from other applications. That's the way IE or Firefox show an AcrobatReader window inside the browser, for example.

To do this, Microsoft created Com (Component Object Model) which is the communication standard.

Now, I believe that the frontier between Ole and Com is a bit fuzzy... Search for "ole com object" for much information that you want. :-)

JeremysDad (At Work)
  • Guests
  • Last active:
  • Joined: --
I'd love to have OLE available as I create a lot of little tools in VBA in Word & Outlook. Right now, I have a set of tools in AHK and another in Word VBA to accomplish similiar tasks in the different applications. Doing things in one place would provide a great deal of simplicity for the users. :D

Having said that; like others here, I am pleased with all that AHK currently offers and recognize the tremendous work that Chris is doing on it.

Thanks!

G

not-logged-in-daonlyfreez
  • Guests
  • Last active:
  • Joined: --
Any of you OLE/COM enthousiasts willing to take a look at this then?

VBScript needed to open an URL in an existing IE window

Much obliged...

BoBo
  • Guests
  • Last active:
  • Joined: --
As DDE is the predecessor of OLE and can be called via DllCall() this would be a "workarround" (eg. to connect to Excel), isn't it ?

Dynamic Data Exchange Messages
Following are the messages used with DDE.

WM_DDE_ACK
WM_DDE_ADVISE
WM_DDE_DATA
WM_DDE_EXECUTE
WM_DDE_INITIATE
WM_DDE_POKE
WM_DDE_REQUEST
WM_DDE_TERMINATE
WM_DDE_UNADVISE

Download: [Win32 API Reference] (for offline use :D)

And btw a sample piece of code (eg. send variable to a cell within Excel) provided by one of our fellow supporters here at the forum would be much appreaciated. Thx. :D

BoBo
  • Guests
  • Last active:
  • Joined: --
Looks like AHK's Send-/PostMessage deals with the above mentioned DDE messages: [List of Windows Messages] ...

AHKnow*
  • Guests
  • Last active:
  • Joined: --
My thought on COM/OLE in AutoHotkey, is mostly to make it easy to use VBScript, JScript, and even .NET scripting IN AutoHotkey. Therefore my position is close to that of PhiLho on this.

It does not make any sense for AutoHotkey to "re-invent" the wheel and come out with its version of COM/OLE syntax. Especially, if AutoHotkey's version of COM/OLE syntax is going to be a virtual copy of VBScript syntax and usage. This was a mistake that I think AutoHotkey's close uncle made.

BUT the BIG problem that I have with how AutoHotkey makes use of VBScript and JScript is the syntax that AutoHotkey uses to include/integrate those scripting languages. I think that AutoHotkey should have specific syntax for integrating VBScripts, JScript, .NET scripts, etc... into AutoHotkey.

A new user is not going to figure out right away that the AutoHotkey command FileAppend can help them integrate VBScript and JScripts. Also, AutoHotkey could make the whole process a lot easier by having more information in the Help files on how to use VBScript and JScript in AutoHotkey for example.

Another closely related issue to the above is needing temp files. You can write your VBScript, JScript, or other INSIDE of an AutoHotkey script, using FileAppend, BUT you need to create a TEMP file to execute it. Search for the topics, Using VBscript in ahk without a temporary file and Visual Basic Script support in AutoHotKey to get more information about this.

It would be nice if you did not have to just use FileAppend and you could use an "Other Script" command to pipe, without needing an temp file, your "Other Script syntax" to cscript.exe or whatever .exe could run it. There has been a number of work arounds ( search for the topic- Using VBscript in ahk without a temporary file ) to deal with this issue such as using CMDRET (a great user contributed DLL) and others.

The issue with the work arounds is that its arguably better to integrate this functionality INTO AutoHotkey as oppose to relying on 3rd party DLLs. I think CMDRET should be integrated into AutoHotkey and specific syntax for handling syntax from other scripting languages, like an "OtherScript" command (as oppose to just Fileappend), are needed.

I think that if AutoHotkey addressed the problem of COM/OLE by embracing and using methods to integrate "foreign syntax and scripts" into an AutoHotkey script that this would be the more advantageous solution and provide a huge level of flexibility to do even more things. An example of this flexibility is that you could use .NET scripting methods such as C# script ( http://www.codeproject.com/dotnet/nscript.asp ) with AutoHotkey (provided that you downloaded the .NET framework). This method would allow you to do even more than what you were doing with VBScript and JScript.

AHKnow*
  • Guests
  • Last active:
  • Joined: --
Another C# scripting language is here http://www.codeproje...ript_for_cp.asp