AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Poll: Are you missing OLE support in Autohotkey?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  

Are you missing OLE support in Autohotkey?
Yes, I'm missing OLE support
53%
 53%  [ 15 ]
No, I never needed OLE support
21%
 21%  [ 6 ]
No and I even don't know what is OLE.
21%
 21%  [ 6 ]
Other reply
3%
 3%  [ 1 ]
Total Votes : 28

Author Message
zorglups



Joined: 04 Feb 2005
Posts: 21

PostPosted: Wed Jan 25, 2006 3:43 pm    Post subject: Poll: Are you missing OLE support in Autohotkey? Reply with quote

From AHKnow: http://www.autohotkey.com/forum/viewtopic.php?t=4046&highlight=ole

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

Some info on OLE:
http://www4.dogus.edu.tr/bim/bil_kay/prog_dil/activex/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.
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Wed Jan 25, 2006 3:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Wed Jan 25, 2006 4:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
zorglups



Joined: 04 Feb 2005
Posts: 21

PostPosted: Wed Jan 25, 2006 8:28 pm    Post subject: Reply with quote

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 Cool ) 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
View user's profile Send private message
zorglups



Joined: 04 Feb 2005
Posts: 21

PostPosted: Wed Jan 25, 2006 8:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Thu Jan 26, 2006 9:29 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Tekl



Joined: 24 Sep 2004
Posts: 813
Location: Germany

PostPosted: Thu Jan 26, 2006 11:02 am    Post subject: Reply with quote

Is OLE the same like COM?
_________________
Tekl
Back to top
View user's profile Send private message Visit poster's website
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...

PostPosted: Thu Jan 26, 2006 2:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Thu Jan 26, 2006 3:18 pm    Post subject: Reply with quote

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. Smile


Last edited by PhiLho on Thu Jan 26, 2006 5:12 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
JeremysDad (At Work)
Guest





PostPosted: Thu Jan 26, 2006 4:05 pm    Post subject: Reply with quote

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. Very Happy

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





PostPosted: Thu Jan 26, 2006 10:23 pm    Post subject: Reply with quote

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...
Back to top
BoBo
Guest





PostPosted: Sat Jan 28, 2006 8:57 am    Post subject: Reply with quote

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 Very Happy)

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. Very Happy
Back to top
BoBo
Guest





PostPosted: Sat Jan 28, 2006 9:09 am    Post subject: Reply with quote

Looks like AHK's Send-/PostMessage deals with the above mentioned DDE messages: [List of Windows Messages] ...
Back to top
AHKnow*
Guest





PostPosted: Thu Feb 23, 2006 3:46 am    Post subject: Reply with quote

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





PostPosted: Thu Feb 23, 2006 4:33 am    Post subject: Reply with quote

Another C# scripting language is here http://www.codeproject.com/csharp/cs-script_for_cp.asp
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group