Skip to content

Instantly share code, notes, and snippets.

@t2psyto
Created September 26, 2012 11:30
Show Gist options
  • Select an option

  • Save t2psyto/3787469 to your computer and use it in GitHub Desktop.

Select an option

Save t2psyto/3787469 to your computer and use it in GitHub Desktop.
coffeescript を ロードして実行する wsf
<?xml version="1.0" encoding="Shift_JIS" standalone="yes" ?>
<package>
<job id="Hoge">
<script language="JScript" src="./coffee-script.js"></script>
<script language="jscript">
<![CDATA[
input = "./script.coffee"
var rs = new ActiveXObject("ADODB.Stream");
rs.Type = 2; // adTypeText
rs.Charset = "utf-8";
rs.Open();
rs.LoadFromFile(input);
var src = rs.ReadText();
CoffeeScript.run(src);
]]>
</script>
</job>
</package>
@t2psyto
Copy link
Author

t2psyto commented Sep 26, 2012

-- coding: utf-8 --

filename: script.coffee

name = "CoffeeScript"

whatIsThis = ->
"This is The " + name + "!"

WScript.Echo whatIsThis()

@t2psyto
Copy link
Author

t2psyto commented Sep 26, 2012

name = "CoffeeScript"

whatIsThis = ->
"This is The " + name + "!"

WScript.Echo whatIsThis()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment