2006/03/08 | [资源]推荐一款 支持命令行 的插件
类别(资源下载) | 评论(0) | 阅读(188) | 发表于 09:47

这里推荐一款 支持命令行 的插件,你可以在director里面直接执行一个dos命令或者一个命令行程序,并得到返回的结果,这个结果可以是字符串也可以是一个列表。语法简洁但功能强大。同时有苹果电脑和Pc电脑两个版本的。另外,这款插件是免费的。

以下是在director中,执行“dir”命令后得到的返回结果截图: 

以下是一些应用的举例:

==============
res = shell_cmd("dir /b", RETURN)
res = shell_cmd("del /S /Q tmp\*.*")
res = shell_cmd("foo.bat myParam)
res = shell_cmd("echo %ProgramFiles%", EMPTY)
res = shell_cmd("echo %NUMBER_OF_PROCESSORS%", EMPTY)

-- fetch a page with curl
res = shell_cmd("curl -v
http://macromedia.com/")

-- list files in rar archive
res = shell_cmd("rar l files.rar", RETURN)

-- fetch a page with curl, clean the result with tidy and return the cleaned html code to director
res = shell_cmd("curl -v
http://macromedia.com/ 2>nul | tidy -c -q 2>nul")

-- convert html-representation of a text member to XHTML
xml = shell_cmd("echo "&QUOTE&str_replace(chr(13)&chr(10),"",member(13).html) &QUOTE& "| tidy -c -asxhtml 2>nul")

-- convert wav to mp3 with lame.exe (catch progress information with _stderr callback)
shell_cmd("lame -b 160 test.wav test.mp3", RETURN)

-- schedule a new task
ret = shell_cmd("schtasks /create /tn MyApp /tr c:\myapp.exe /sc daily /mo 2 /st 13:00:00 /sd 6/30/2004")

-- start the local Apache Webserver as service
ret = shell_cmd("sc start Apache")

-- execute php code with php interpreter (needs php.exe (cli) and php4ts.dll)
ret = shell_cmd("php -r phpinfo();")

-- execute python code with python interpreter (needs python.exe, python23.dll and Lib)
ret = shell_cmd("python -c " &QUOTE& "import sys; print sys.path" &QUOTE, RETURN)

官方下载页面:
 
本站下载连接:

 

0

评论Comments