| View previous topic :: View next topic |
| Are you missing OLE support in Autohotkey? |
| Yes, I'm missing OLE support |
|
53% |
[ 15 ] |
| No, I never needed OLE support |
|
21% |
[ 6 ] |
| No and I even don't know what is OLE. |
|
21% |
[ 6 ] |
| Other reply |
|
3% |
[ 1 ] |
|
| Total Votes : 28 |
|
| Author |
Message |
zorglups
Joined: 04 Feb 2005 Posts: 21
|
Posted: Wed Jan 25, 2006 3:43 pm Post subject: Poll: Are you missing OLE support in Autohotkey? |
|
|
From AHKnow: http://www.autohotkey.com/forum/viewtopic.php?t=4046&highlight=ole
------------------------
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. |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
Posted: Wed Jan 25, 2006 3:51 pm Post subject: |
|
|
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. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed Jan 25, 2006 4:02 pm Post subject: |
|
|
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... |
|
| Back to top |
|
 |
zorglups
Joined: 04 Feb 2005 Posts: 21
|
Posted: Wed Jan 25, 2006 8:28 pm Post subject: |
|
|
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:
| Code: | 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:
| Code: | ' 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 ) 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
Last edited by zorglups on Thu Feb 02, 2006 11:22 pm; edited 3 times in total |
|
| Back to top |
|
 |
zorglups
Joined: 04 Feb 2005 Posts: 21
|
Posted: Wed Jan 25, 2006 8:34 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Thu Jan 26, 2006 9:29 am Post subject: |
|
|
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.
<OT>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?)
</OT> |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Thu Jan 26, 2006 11:02 am Post subject: |
|
|
Is OLE the same like COM? _________________ Tekl |
|
| Back to top |
|
 |
JSLover
Joined: 20 Dec 2004 Posts: 542 Location: LooseChange911.com... the WTC attacks were done by the US Gov't... the official story is a lie...
|
Posted: Thu Jan 26, 2006 2:19 pm Post subject: |
|
|
| PhiLho wrote: | | 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! _________________
Home • Click image! • Blog |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Thu Jan 26, 2006 3:18 pm Post subject: |
|
|
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. 
Last edited by PhiLho on Thu Jan 26, 2006 5:12 pm; edited 1 time in total |
|
| Back to top |
|
 |
JeremysDad (At Work) Guest
|
Posted: Thu Jan 26, 2006 4:05 pm Post subject: |
|
|
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.
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 |
|
| Back to top |
|
 |
not-logged-in-daonlyfreez Guest
|
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Sat Jan 28, 2006 8:57 am Post subject: |
|
|
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 )
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.  |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Sat Jan 28, 2006 9:09 am Post subject: |
|
|
| Looks like AHK's Send-/PostMessage deals with the above mentioned DDE messages: [List of Windows Messages] ... |
|
| Back to top |
|
 |
AHKnow* Guest
|
Posted: Thu Feb 23, 2006 3:46 am Post subject: |
|
|
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/csharp/CSharpScript.asp?df=100&forumid=258263&exp=0&select=1342586 ) and NScript ( 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. |
|
| Back to top |
|
 |
AHKnow* Guest
|
|
| Back to top |
|
 |
|