PDA

View Full Version : Free Plugin : Script Plugin


AMSWaves
09-22-2008, 01:59 PM
Hi All.
We Released a new plugin.

with this plugin you able execute VBScript and JScript from into and out of AMS and get result that beforehand execute in Plugin.

Enjoy It!


Download (http://www.amswaves.com/index.php?option=com_content&view=article&id=49&Itemid=55)

Help (http://www.amswaves.com/helps/AMSWScript_Help.htm)

Forum (http://forum.amswaves.com/viewtopic.php?f=6&t=17)

Please Reply:yes

JDog37
09-22-2008, 03:05 PM
Very nice of you to put out yet another FREE plug-in!! :cool

Thank You. I don't know coding much but I'm learning, so I'm sure I'll get to use it someday..:rolleyes

Thanks again!

Dermot
09-23-2008, 01:31 AM
Works really well on XP but it crashes the app when it loads on Vista. This is a very powerful tool so if you can get it to run on Vista, that would be great.

AMSWaves
09-23-2008, 07:42 AM
Very nice of you to put out yet another FREE plug-in!! :cool

Thank You. I don't know coding much but I'm learning, so I'm sure I'll get to use it someday..:rolleyes

Thanks again!

Hi JDog37 Thanks,
This is a good plugin but you must know programing in VBScript Or JScript.

For Example Whit this smidgen code you can get Hard information :

code =[[
Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_DiskDrive",,48)
For Each objItem in colItems
hardinfo = "BytesPerSector: " & objItem.BytesPerSector & vbCRLF &_
"Caption: " & objItem.Caption & vbCRLF &_
"Description: " & objItem.Description & vbCRLF &_
"DeviceID: " & objItem.DeviceID & vbCRLF&_
"Index: " & objItem.Index & vbCRLF&_
"InterfaceType: " & objItem.InterfaceType & vbCRLF&_
"Manufacturer: " & objItem.Manufacturer & vbCRLF&_
"MediaLoaded: " & objItem.MediaLoaded & vbCRLF&_
"MediaType: " & objItem.MediaType & vbCRLF&_
"Model: " & objItem.Model & vbCRLF&_
"Name: " & objItem.Name & vbCRLF&_
"Partitions: " & objItem.Partitions & vbCRLF&_
"SectorsPerTrack: " & objItem.SectorsPerTrack & vbCRLF&_
"Signature: " & objItem.Signature & vbCRLF&_
"Size: " & objItem.Size & vbCRLF&_
"TotalCylinders: " & objItem.TotalCylinders & vbCRLF&_
"TotalHeads: " & objItem.TotalHeads & vbCRLF&_
"TotalSectors: " & objItem.TotalSectors & vbCRLF&_
"TotalTracks: " & objItem.TotalTracks & vbCRLF&_
"TracksPerCylinder: " & objItem.TracksPerCylinder
Next
]]

Script.SetLanguage(Script_VBScript);
Script.AddCode(code, Script_InternalCode);
hardinfo = Script.GetResultAsString("hardinfo");
Dialog.Message("", hardinfo)

AMSWaves
09-23-2008, 07:58 AM
Works really well on XP but it crashes the app when it loads on Vista. This is a very powerful tool so if you can get it to run on Vista, that would be great.

Hi Dermot,
Thanks for report on Vista, we must work on it to work on vista and we want add some new functions.

AMSWaves
09-23-2008, 08:04 AM
For Create Code in VBScript this tool can come handy :

Best Regards,
AMSWaves.

mwreyf1
09-23-2008, 02:28 PM
THANKS!!!

This is an awesome plugin.

One question.

How would I go about passing a variable into the code section?

Possibily using Wscript.Arguments...

AMSWaves
09-24-2008, 09:58 PM
How would I go about passing a variable into the code section?


code section is a string you can use a (..) to add variables into code section.

For example :

code =[[
Function Addition(arg1, arg2)
Addition = arg1+arg2
End Function

result = Addition(]].."1234, 4321"..[[)
]]

Script.SetLanguage(Script_VBScript);
Script.AddCode(code, Script_InternalCode);
result = Script.GetResultAsLong("result");
Dialog.Message("Notice", result);




Possibily using Wscript.Arguments...

Wscript.Arguments in this plugin never Possible because this plugin never convert your AMS app to a vbs (VBScript) file this plugin just execute your VBScript or JScript code but if you want use Wscript.Arguments in app you can use _CommandLineArgs For Example :


if _CommandLineArgs[1] ~= nil then
arg = "Dim Arg("..(Table.Count(_CommandLineArgs)-1)..")\r\n"
for num = 1, Table.Count(_CommandLineArgs) do
arg = arg.."Arg("..(num-1)..") = \"".._CommandLineArgs[num].."\"\r\n"
end
end


Use this code into On Startup, this code get your CommandLineArgs and then convert it into a array (In VBScript language), then you can append it with your code section and use it on VBScript code.

mwreyf1
09-25-2008, 08:52 AM
I'm not sure if that is what I need.

Here is an example based off of your code.

How would you go about asking the end user at runtime what number he/she wants to add to arg1 ("1234") and get the correct response?

TIA

AMSWaves
09-25-2008, 09:22 AM
I'm not sure if that is what I need.

Here is an example based off of your code.

How would you go about asking the end user at runtime what number he/she wants to add to arg1 ("1234") and get the correct response?

TIA

HI mwreyf1,
AMOUNT2ADD is a Variable but you in line 12 add it as String
End Function

result = Addition(]].."1234, AMOUNT2ADD"..[[)
]]

if you use Dialog.Message("Notice", code); in end of your code you can see whats wrong.

7111

change line 12 from :

result = Addition(]].."1234, AMOUNT2ADD"..[[)

to :

result = Addition(]].."1234, "..AMOUNT2ADD..[[)

for correcting your code every time use a debugger like Dialog.Message("Notice", code); then you can see your code and correct it.


Best Regards,
AMSWaves.

mwreyf1
09-25-2008, 09:25 AM
Thanks for your help.

Working great now.

This is a GREAT plugin.

It adds so many possibilities to AMS.

As far as I'm concerned this is the BEST plugin you guys have done to date.

Thanks, again.

AMSWaves
09-25-2008, 09:37 AM
Thanks for your help.

Working great now.

This is a GREAT plugin.

It adds so many possibilities to AMS



Thanks,
Yea, with this plugin you can add very possibilities to AMS.
For Examp with this code you can get name of all files on a folder :

function DelimitedStringToTable(DelimitedString, Delimiter)
tbReturn = {};
local strWorking;
local nPos = nil;
local strData;
local nTableIndex = 1;
local nDelimiterLength = String.Length(Delimiter);

if(nDelimiterLength < 1)then
tbReturn[nTableIndex] = DelimitedString;
return tbReturn;
end

strWorking = DelimitedString;
nPos = String.Find(strWorking,Delimiter);
while(nPos ~= -1)do
strData = String.Left(strWorking,nPos-1);
tbReturn[nTableIndex] = strData;
nTableIndex = nTableIndex + 1;
local nLength = String.Length(strWorking);
strWorking = String.Right(strWorking,nLength - (nPos + (nDelimiterLength-1)));
nPos = String.Find(strWorking,Delimiter);
end
if(strWorking ~= "")then
tbReturn[nTableIndex] = strWorking;
end

return tbReturn;
end

code =[[
Function ShowFolderList(folderspec)
Dim fso, f, f1, fc, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set fc = f.Files
For Each f1 in fc
s = s & f1.name & "|"
Next
ShowFolderList = Left(s, Len(s)-1)
End Function

files = ShowFolderList("C:\Program Files\AutoPlay Media Studio 7.0")
]]

Script.SetLanguage(Script_VBScript);
Script.AddCode(code, Script_InternalCode);
files = DelimitedStringToTable(Script.GetResultAsString("files"), "|")
Debug.ShowWindow(true)
for a,b in files do
Debug.Print(b.."\r\n")
end

AMSWaves
09-25-2008, 09:46 AM
As far as I'm concerned this is the BEST plugin you guys have done to date.


when we create this plugin we thinked this is a very very good plugin and we thinked this have very votary, but this plugin dont have many votary, we dont know why ?

mwreyf1
09-25-2008, 09:51 AM
I do a LOT of network related stuff where I work and I have always had to call .vbs files externally with commandargs. Now I can use that code inside of AMS.

AWESOME !!!

I am surprised more people haven't jumped all over this.

You don't really have to know .vbs code. There is a .vbs already written to do just about anything one could imagine.

reteset
09-28-2008, 06:55 AM
really good job :yes
this plugin adds a sub language support to AMS

i am wondering .
which language did you use

why i am asking this:


i am looking in to resource section of all DLL's which i found/got
but i seen nothing except Version Rc. in your plugin
it is one thing that i am in interest

i am working on a runtime engine for an advanced project
i tried something for merge a resource in to a PE (it is OK)
but i could not make a well procedure for read/extract them

simply , i need help with : adding a resource to a PE but not into default resource section

i think your plugin works well with hidden resources

have you a suggestion for make it

thank you

AMSWaves
09-28-2008, 04:09 PM
Hi reteset,

really good job :yes
this plugin adds a sub language support to AMS

i am wondering .


Thanks.

which language did you use

why i am asking this:


i am looking in to resource section of all DLL's which i found/got
but i seen nothing except Version Rc. in your plugin
it is one thing that i am in interest

i am working on a runtime engine for an advanced project
i tried something for merge a resource in to a PE (it is OK)
but i could not make a well procedure for read/extract them

simply , i need help with : adding a resource to a PE but not into default resource section

i think your plugin works well with hidden resources

have you a suggestion for make it

thank you


Dear reteset if you want create a project for yourself we can help you on its PE or if you want create a project for AMS we can do it together (We & You), anyway AMSWaves is ready for help because sometimes you can help us :).

GoOgLe
02-26-2009, 05:55 AM
i was wondering if it is possible to add a javascript code to a html page between "<head> </head> " on runtime with this plugin ???

This Code:
<script language="JavaScript">
document.body.style.zoom="150%";
</script>

mwreyf1
10-20-2009, 10:03 AM
I have just finished testing AMS 7.5.1008.0 on the final release version of Windows 7 and I am having a problem with this plugin.

I first do a web exe build and it starts up fine, but when I close it, it still shows under Task Manager\Proccess as running and will eventually time out and give an error.

Below is the Windows 7 error log contents for the error.

<?xml version="1.0" encoding="UTF-16"?>
<DATABASE>
<EXE NAME="autorun.exe" FILTER="CMI_FILTER_PRIVACY">
<MATCHING_FILE NAME="autorun.exe" SIZE="2830336" CHECKSUM="0x330BB283" BIN_FILE_VERSION="7.5.1008.0"

BIN_PRODUCT_VERSION="7.5.1008.0" PRODUCT_VERSION="7.5.1008.0" FILE_DESCRIPTION="AutoPlay Application"

COMPANY_NAME="" PRODUCT_NAME="AutoPlay Media Studio Runtime" FILE_VERSION="7.5.1008.0"

ORIGINAL_FILENAME="ams_runtime.exe" INTERNAL_NAME="ams_runtime" LEGAL_COPYRIGHT="Runtime Engine Copyright © 2009

Indigo Rose Corporation (www.indigorose.com)" VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x40004" VERFILETYPE="0x1"

MODULE_TYPE="WIN32" PE_CHECKSUM="0x0" LINKER_VERSION="0x0" UPTO_BIN_FILE_VERSION="7.5.1008.0"

UPTO_BIN_PRODUCT_VERSION="7.5.1008.0" LINK_DATE="10/09/2009 12:21:22" UPTO_LINK_DATE="10/09/2009 12:21:22"

VER_LANGUAGE="English (United States) [0x409]" EXE_WRAPPER="0x0" />
</EXE>
<EXE NAME="ntdll.dll" FILTER="CMI_FILTER_THISFILEONLY">
<MATCHING_FILE NAME="ntdll.dll" SIZE="1286144" CHECKSUM="0x1220566E" BIN_FILE_VERSION="6.1.7600.16385"

BIN_PRODUCT_VERSION="6.1.7600.16385" PRODUCT_VERSION="6.1.7600.16385" FILE_DESCRIPTION="NT Layer DLL"

COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System"

FILE_VERSION="6.1.7600.16385 (win7_rtm.090713-1255)" ORIGINAL_FILENAME="ntdll.dll.mui" INTERNAL_NAME="ntdll.dll"

LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x40004"

VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0x14033F" LINKER_VERSION="0x60001"

UPTO_BIN_FILE_VERSION="6.1.7600.16385" UPTO_BIN_PRODUCT_VERSION="6.1.7600.16385" LINK_DATE="07/14/2009 01:09:47"

UPTO_LINK_DATE="07/14/2009 01:09:47" EXPORT_NAME="ntdll.dll" VER_LANGUAGE="English (United States) [0x409]"

EXE_WRAPPER="0x0" FILE_ID="00009d56bf20851f26960c4c33dd4bde84730c8d483f"

PROGRAM_ID="0000f519feec486de87ed73cb92d3cac802400000000" />
</EXE>
<EXE NAME="kernel32.dll" FILTER="CMI_FILTER_THISFILEONLY">
<MATCHING_FILE NAME="kernel32.dll" SIZE="857088" CHECKSUM="0x22F48E19" BIN_FILE_VERSION="6.1.7600.16385"

BIN_PRODUCT_VERSION="6.1.7600.16385" PRODUCT_VERSION="6.1.7600.16385" FILE_DESCRIPTION="Windows NT BASE API Client

DLL" COMPANY_NAME="Microsoft Corporation" PRODUCT_NAME="Microsoft® Windows® Operating System"

FILE_VERSION="6.1.7600.16385 (win7_rtm.090713-1255)" ORIGINAL_FILENAME="kernel32" INTERNAL_NAME="kernel32"

LEGAL_COPYRIGHT="© Microsoft Corporation. All rights reserved." VERDATEHI="0x0" VERDATELO="0x0" VERFILEOS="0x40004"

VERFILETYPE="0x2" MODULE_TYPE="WIN32" PE_CHECKSUM="0xD5597" LINKER_VERSION="0x60001"

UPTO_BIN_FILE_VERSION="6.1.7600.16385" UPTO_BIN_PRODUCT_VERSION="6.1.7600.16385" LINK_DATE="07/14/2009 01:09:01"

UPTO_LINK_DATE="07/14/2009 01:09:01" EXPORT_NAME="KERNEL32.dll" VER_LANGUAGE="English (United States) [0x409]"

EXE_WRAPPER="0x0" FILE_ID="00004f0b455c60c4292a488291d8c29f48aeec7a17e7"

PROGRAM_ID="0000f519feec486de87ed73cb92d3cac802400000000" />
</EXE>
</DATABASE>


I really use this plugin a LOT so if you have some spare time could you please look at this to see if it would be possible to correct the issue.

It loosk like a possible stack overflow from reading another log file that is created. I didn't include that file since it is full of mostly compiled code so it is unreadable.

Thanks for the GREAT plugin.