[AHK]用AHK执行JavaScript

来源:互联网 发布:windows遭遇关键问题 编辑:程序博客网 时间:2024/06/05 17:57
sc := ComObjCreate("ScriptControl");// define the Languagesc.Language := "JScript";// define the JScriptscript =(string = '';obj = { 'Name':'AutoHotkey', 'URL':'www.AutoHotkey.com', 'Color':'Green' };for (i in obj)   string += i + ' = ' + obj[i] + '\n';);// execute the JScriptsc.ExecuteStatement(script);// extract a value from the JScriptMsgBox, 0, JScript Variable "string":, % sc.Eval("string");// extract an Object from the JScriptobj := sc.Eval("obj") MsgBox, 0, Elements from the JScript Object:, % "Name: " obj.Name "`nURL: " obj.URL

0 0