cycle4passion icon

COM JS

cycle4passion | PRO | 04/22/17 03:13:47 PM UTC | 0 ⭐ | 10516 👁️ | Never ⏰ | []
Autohotkey |

660 B

|

None

|

0 👍

/

0 👎

;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

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎