Jump to content

How to embed script interpretor into autoit


Recommended Posts

I am trying to understand whether its will be possible to embed any script interpretor such as Ruby, perl inside an edit control. Doe's someone did it before with any kind of script interpretor?

I am actually trying to accomplish a tool that would be able to use interpretor inside autoit.

Thanks

Edited by lsakizada

Be Green Now or Never (BGNN)!

Link to comment
Share on other sites

Search the forums for "ScriptControl". You'll find examples with Javascript -- same can be done with vbscript and perlscript (if you have activestate installed) and ant other installed languages that support the ActiveX Scripting Specification.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Thanks DaleHohm!

Search the forums for "ScriptControl".

I was aware of the interpreter engine but I did not know it's name.

Yes this certainely can help to embed language scripting into autoit.

I am trying to figure how how to use perl and other scripting engines beside of Jscript and VBScript

since I need multithread environment.

I will be glad If anyone else knows which other script engine can do this job.

Be Green Now or Never (BGNN)!

Link to comment
Share on other sites

hi

i have done some test with perl too

the perl evalutation code needs to be all in ONE line which is hard to read now

so far i guess its only good for little script helps , but not to integrate BIG perl programs..

if you use a PM Module its not such a problem , can be called from the embedded perl too.

perl and autoit variables can be exchanged now nicely.

more information here

http://thomaslauer.com/comp/Calling_Perl

nobbe

CODE
#include <perl.au3>

If (Not PerlInit ()) Then ; first thing

MsgBox(0, "", "Perl not found...")

; Exit

Else

; my perl variable now..

PerlSetStr ("filename", 'test.wma')

PerlEval ("use Audio::WMA;print ""("";print $filename;print "")\n"";$wma=Audio::WMA->new($filename);$info=$wma->info();$drm=$info->{drm};$tags=$wma->tags();$tt=$tags->{TITLE};$ta=$tags->{AUTHOR};$talb=$tags->{ALBUMTITLE};$t_year=$tags->{YEAR}")

$tta = ps("ta") ; artist

$ttt = ps("tt"); title

$talbum = ps("talb");

$year = ps("t_year");

$tdrm = ps("drm")

MsgBox(0, "From PERL", "artist =" & $tta & @CRLF & "title = " & $ttt & @CRLF & "Album = " & $talbum & @CRLF & "Year = " & $year & @CRLF & "DRM = " & $tdrm & @CRLF)

PerlSetStr ("filename", 'test1.wma')

PerlEval ("use Audio::WMA;$wma=Audio::WMA->new($filename);$info=$wma->info();$drm=$info->{drm};$tags=$wma->tags();$tt=$tags->{TITLE};$ta=$tags->{AUTHOR};$talb=$tags->{ALBUMTITLE};$t_year=$tags->{YEAR}")

$tta = ps("ta") ; artist

$ttt = ps("tt"); title

$talbum = ps("talb");

$year = ps("t_year");

$tdrm = ps("drm")

MsgBox(0, "From PERL", "artist =" & $tta & @CRLF & "title = " & $ttt & @CRLF & "Album = " & $talbum & @CRLF & "Year = " & $year & @CRLF & "DRM = " & $tdrm & @CRLF)

; exit Perl

PerlExit () ; last thing

EndIf

Edited by nobbe
Link to comment
Share on other sites

I am trying to figure how how to use perl and other scripting engines beside of Jscript and VBScript

since I need multithread environment.

Regarding Perl, as I mentioned before, if you install the ActiveState Perl distribution you will get an ActiveX Scripting compliant variant of Perl installed called "perlscript". You can then use language=perlscript with the ScriptControl just as you do Javascript and VBScript (just like you can with ASP web pages).

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...