Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;https://autohotkey.com/board/topic/56987-com-object-reference-autohotkey-l/#entry358974
- sc := ComObjCreate("ScriptControl")
- ;// define the Language
- sc.Language := "JScript"
- ;// define the JScript
- script =
- (
- string = '';
- obj = { 'Name':'AutoHotkey', 'URL':'www.AutoHotkey.com', 'Color':'Green' };
- for (i in obj)
- string += i + ' = ' + obj[i] + '\n';
- )
- ;// execute the JScript
- sc.ExecuteStatement(script)
- ;// extract a value from the JScript
- MsgBox, 0, JScript Variable "string":, % sc.Eval("string")
- ;// extract an Object from the JScript
- obj := sc.Eval("obj")
- MsgBox, 0, Elements from the JScript Object:, % "Name: " obj.Name "`nURL: " obj.URL
Advertisement