 |
AutoHotkey Community Wir helfen uns gegenseitig aus der Patsche
|
| Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
| Vermisst Du OLE Unterstützung in AutoHotkey ? |
| Ja, ich vermisse OLE Unterstützung! |
|
62% |
[ 5 ] |
| Nein, hab ich noch nie gebraucht. |
|
12% |
[ 1 ] |
| Nein, und was ist eigentlich OLE ? |
|
12% |
[ 1 ] |
| Andere Antwort ... |
|
12% |
[ 1 ] |
|
| Stimmen insgesamt : 8 |
|
| Autor |
Nachricht |
BoBo
Anmeldedatum: 09.05.2007 Beiträge: 2
|
Verfasst am: Mi Aug 01, 2007 7:59 pm Titel: AutoHotkey mit JScript oder VBScript (WSH) verwenden |
|
|
erictheturtle's Windows Scripting für Autohotkey.
ws4ahk - erlaubt VBScript und/oder JScript direkt in ein AutoHotkey Skript einzubetten.
Es arbeitet völlig selbstständig: keine DLLs oder zusätzliche Skripte werden benötigt.
Damit wird aus AHK Skripten ein (in)direkter Zugriff auf COM Objekte ermöglicht.
[Download]
[Homepage] |
|
| Nach oben |
|
 |
BoBo¨ Gast
|
Verfasst am: Mi Aug 01, 2007 8:18 pm Titel: |
|
|
Einleitung aus dem original Thread [hier] | Zitat: | erictheturtle - posted: Wed Jul 11, 2007 1:08 pm
Embedded Windows Scripting (VBScript & JScript) and COM
--------------------------------------------------------------------------------
(Note from moderator: Until Eric gets a chance to update this post, here's a link to his new homepage for his Windows Scripting Host API: http://www.autohotkey.net/~easycom/). This topic was split off from the old topic "EasyCOM.dll" development
I've been thinking long and hard about using Microsoft Scripting Control to provide easy COM usage to AHK, and the more I have, the more it became the ultimate choice--far better than anything I could develop myself.
Pros
* Automatic objct management (objects are automatically deallocated--no memory leaks!)
* Able to use either VBScript or JScript to write COM related code
* ByRef argument handling is all taken care of
* Almost all VARIANT handling is taken care of
* Can very easily write compound COM statements (e.g. objExcel.Workbooks.Add().Sheets(1).Cells(1,1).Value = 50)
* Can even use Microsoft Scripting Control to extend your AHK script with VBScript or JScript plugins!
* There's no need for an extra dll (like EasyCOM.dll). It can all be done using scripts like Sean has written.
* Much more easily implemented!
The ONLY disadvantage with using Microsoft Scripting Control is that there may be some computers that do not have it installed (but probably not very many). HOWEVER, not only is it available to download from Microsoft and very easily installed, but thanks to that CreateObjectFromDll() function, it doesn't even have to be installed! If a computer doesn't have Microsoft Scripting Control installed, you just need to supply the msscript.ocx file in the same folder as your script, and it will still work perfectly. No need to register the OCX. Your script remains completely portable!
Once this is better tested and found to really work, I think you can agree that there is no reason to continue making the not-so-easy EasyCOM.dll anymore. This is by far a better solution. |
|
|
| Nach oben |
|
 |
halweg
Anmeldedatum: 05.01.2006 Beiträge: 675 Wohnort: Dresden
|
Verfasst am: Mi Aug 01, 2007 9:59 pm Titel: |
|
|
| Ich finde, dass AHK nicht überfrachtet werden sollte, jede zusätzliche Option macht es schwerer wartbar, der gegenwärtige Stand ist schon das Maximum dessen, was man einer einfachen Skriptsprache zumuten kann. |
|
| Nach oben |
|
 |
BoBo¨ Gast
|
Verfasst am: Do Aug 02, 2007 8:03 am Titel: |
|
|
| Zitat: | | Ich finde, dass AHK nicht überfrachtet werden sollte | Optionen wie CoHelper.ahk/IEControl.ahk oder wsh4ahk.ahk sind (derzeit) separate Scripte, welche lediglich includiert werden um damit zusätzliche Funktionalität anzubieten. Etwas was viele von uns mit eigenen Scripten ja problemlos nutzen. Man/frau kann also - muss aber nicht.
Einen derzeitigen Ansatzpunkt für Kritik sehe ich in der rudimentären Dokumentation dieser Scripte. Dem kann man/frau entgegenhalten, das diese Thematik per se eh nur von Wissenden genutzt werden wird. Also ist die Situation nicht anders wie derzeit mit Send-/PostMessage oder DllCall(), welche beide gut dokumentiert sind - und trotzdem nur einen überschaubaren Nutzerkreis anzusprechen scheinen.
Ich schätze erweiterte Möglichkeiten für AHK, da ich in manchen Situationen so nicht gezwungen sein werde eine andere/weitere Programmiersprache lernen zu müssen, nur um ein einzelnes Problem lösen zu können.  |
|
| Nach oben |
|
 |
Chucky
Anmeldedatum: 07.01.2006 Beiträge: 576 Wohnort: Powerland
|
Verfasst am: Do Aug 02, 2007 9:12 pm Titel: |
|
|
Mit VBScript kann man wunderbar auf Excel-Elemente zugreifen, ohne sich Gedanken über deren Struktur machen zu müssen. Das ist die einzige Anwendung, für die ich VBScript brauche.
Ist der Windows Scripting Host installiert, lassen sich VBScripte auch mit AutoHotkey generieren und starten.
Wenn die VBScripte behandelt werden wie andere Kommandozeilen-Programme, die Parameter entgegennehmen und Werte zurückliefern, reichen für GUI-lose Anwendungen Befehle wie FileAppend und RunWait oder corrupt's CMDret vollkommen aus.
__________________________________________
Created with BBCodeWriter 7.0 - the one and only  |
|
| Nach oben |
|
 |
|
|
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten.
|
Powered by phpBB © 2001, 2005 phpBB Group Deutsche Übersetzung von phpBB.de
|