DevMSN+

酷酷的MSN插件,随心所欲MSN

Messenger Plus! Live - Scripting Documentation

Working with Scripts

Packaging your Script

Having the best script in the world is pretty much useless if you can't share it with other people. Because scripts were designed to be rapidly developed, they were also designed to be rapidly shared. For that reason, Messenger Plus! Live comes with its own script installation mechanism called Script Pack.

溴>


Messenger Plus! Live -脚本文件



工作与脚本
包装您的脚本


有最好的脚本,在世界上是非常无用的,如果您不能分享它与
其他人。因为脚本被设计为迅速发展,他们
也有设计,可以迅速共享。出于这个原因,再加上即时通讯!
活来与自己的脚本安装的机制,所谓的脚本包。

有最好的脚本,在世界上是非常无用的,如果您不能分享它与
其他人。因为脚本被设计为迅速发展,他们
也有设计,可以迅速共享。出于这个原因,再加上即时通讯!
活来与自己的脚本安装的机制,所谓的脚本包。

A Script Pack is a single file, with a ".plsc" extension, containing all the files and sub directories of your script. Creating such a file is ridiculously easy for simple reason: Script Packs are just and only plain zip files with a different extension. This means that you only need to zip all the files in your script directory (with your favorite zip tool, like Winzip) and replace the ".zip" extension with ".plsc". Only one thing is required to make your zip file a valid Script Pack: a ScriptInfo.xml file.

一个脚本包是一个单一档案中,有一个“ 。 plsc ”扩建工程,包含所有
档案和分目录您的脚本。建立这样的档案是可笑
容易,原因很简单:脚本Pack是公正和只有平原的ZIP文件,与一
不同的扩展名。这意味着你只需要压缩的所有文件在您的
脚本目录(与您最喜爱的压缩工具,像
WinZip ) ,然后取代
“邮编”延长“ 。 plsc ” 。只有一件事是需要,使您的邮编
文件
一个有效的脚本包:一scriptinfo.xml档案。

一个脚本包是一个单一档案中,有一个“ 。 plsc ”扩建工程,包含所有
档案和分目录您的脚本。建立这样的档案是可笑
容易,原因很简单:脚本Pack是公正和只有平原的ZIP文件,与一
不同的扩展名。这意味着你只需要压缩的所有文件在您的
脚本目录(与您最喜爱的压缩工具,像
WinZip ) ,然后取代
“邮编”延长“ 。 plsc ” 。只有一件事是需要,使您的邮编
文件
一个有效的脚本包:一scriptinfo.xml档案。

ScriptInfo.xml is a file placed in the script's directory (along with ".js" files). It is read when the script is loaded or imported and contains several information related to the script such as its name, its description, the menus it displays in Messenger, etc... the file does not need to be created for scripts to run locally, however, its presence is mandatory if the script has to be exported into a Script Pack. A full description of the content of the file can be found in the ScriptInfo Schema Reference, here is however an example of a simple ScriptInfo file that you can use for your script:

scriptinfo.xml是一个文件,放置在
脚本的目录(随“ 。 js ”文件) 。这是阅读时,脚本是
装货或进口,并包含几个相关信息的脚本,如
正如其名,其描述,菜单显示,在即时通讯等..那个
文件并不需要创造脚本运行在本地,但其
存在是强制性的,如果脚本要出口到一个脚本包。字母a
充分说明的内容,该文件可以发现,在
scriptinfo架构参考,这里是
但一
例如一个简单的scriptinfo文件,您可以使用您的脚本:

<ScriptInfo>	
	<Information>
		<Name>My First Script</Name>
		<Description>This is my first script.</Description>
		<AboutUrl>http://www.msgpluslive.net</AboutUrl>
		<Version>1.00</Version>
	</Information>
</ScriptInfo>

Just copy paste what's above in a new text file, save it in your script's directory and rename it to "ScriptInfo.xml". The xml file can be saved in Unicode (UTF-16) if your language requires it. Now, select all the files in your script's directory, zip them and rename the zip file with a ".plsc" extension (example: rename "My First Script.zip" to "My First Script.plsc"). Your Script Pack is ready to go! to test it, just sign in Messenger and double click on the plsc file you've just created, if you followed the steps above correctly, you will get the "Import Script" window of Messenger Plus! Live. Once the script is imported, it is automatically activated. If a script with the same name already exists in the user's directory, its files are transparently replaced with the new ones (useful for upgrades).

只要复制粘贴什么的上述在一个新的文本文件,将其保存在您的脚本中的
目录和它重新命名为“ scriptinfo.xml ” 。 XML文件可以保存在
Unicode的(为UTF - 16 )如果您的语言要求。现在,选择的所有文件在您的
脚本的目录,邮递区号他们,并重新命名为ZIP文件,与一“ 。 plsc ”延长
(例如:重命名: “我的第一script.zip ”到“我的第一script.plsc ” ) 。您的脚本
Pack是准备去!以测试它,则只需登录信使并双击
该plsc档案您刚刚建立,如果您遵循上述步骤正确,您将获得
“导入脚本”窗口Messenger Plus! Live 。一旦剧本是进口的,它
是自动启动。如果脚本具有相同名称已经存在于
用户的目录,其
档案是透明的取代与新的(有用的升级) 。

In the XML code specified above, only <Name> is a required element. <Description>, <AboutUrl>, and <Version> can be removed if not needed. To ensure forward compatibility, specify the version of the script in the <Version> element (Messenger Plus! Live 4.20 and later) and not in the <Name> element. This will prevent duplicated copies of the same script from being installed on a user's system (as the name of the script is used to create the corresponding script's directory).

在XML代码上面指定的,只有<姓名>
是一个必需的元素。 <description> ,
<abouturl> ,和<版本>可以删除,如果没有必要。以确保向前兼容性,指定版本的脚本,在
<版本>元素( Messenger Plus! Live 4.20
和更高版本)而不是在
<名称>元素。这将防止重复副本
对同一脚本被安装在用户的系统(如名称,该
脚本是用来建立相应的脚本的目录中) 。

 If you look at the first picture in ScriptInfo Schema Documentation, you'll see that several other elements are also available aside from <Information>. Two of them can be used during import: <OleFiles> and <DotNetFiles>. These are to be used if your script replies on external COM/ActiveX or .NET objects created by yourself or not supposed to come in standard with Windows. Files listed in those two elements will be registered properly in the system when the script is imported. For example, if you created an ActiveX object in VisualBasic for your script called "ExtraFunctionsVB.dll" (loaded with JScript's ActiveXObject object), your ScriptInfo file would have to look like this:

如果您
看看第一张图片在
scriptinfo架构文件,您就可以看到其他几个要素
还有,除了<information> 。他们两人可以
期间使用的进口: <olefiles>和
<dotnetfiles> 。这些都是被用作如果你的脚本
答复对外部的COM / ActiveX或。 NET中创建的对象由自己或不
假定来在标准与Windows 。文件中列出的两个要素,将
注册适当的在系统中,当
剧本是进口。例如,如果您创造了一个ActiveX对象在visualbasic
为您的脚本
所谓“ extrafunctionsvb.dll ” (满载

JScript中的activexobject对象) ,您的scriptinfo档案会看起来像
这:

<ScriptInfo>	
	<Information>
		<Name>My First Script</Name>
	</Information>

	<OleFiles>	
		<FileName>ExtraFunctionsVB.dll</FileName>
	</OleFiles>
</ScriptInfo>

If you still have doubts about how to do something in particular in your ScriptInfo.xml file, you can download existing Script Pack files, change their extension to ".zip" and take a look at how the developer of the script created his own ScriptInfo file. Also, remember to always use a good XML editor to create your XML files as a real XML editor can validate your syntax and insure that your elements conform to the specified schema file. This will save you long hours of searching for errors caused by a missing or invalid tag in your XML file.

如果您
仍然有疑问,如何做一些事情,特别是在您的

scriptinfo.xml文件,您可以下载现有的脚本包文件,更改
他们的扩展“ 。邮编” ,并看看如何开发脚本
创造了他自己的scriptinfo档案。此外,请记住要始终使用一个良好的XML编辑器来创建您
XML文件作为一个真正的XML编辑器可以验证您的语法和保证您的
要素符合指定的架构文件。这将节省您的
长时间的搜索错误所造成的失踪或无效的标记在您的XML
文件。

See Also

Introduction to Scripting, ScriptInfo Schema Reference.

介绍了脚本,
scriptinfo架构参考。

Sponsor

copyright devmsn.com