hta

hta

am 30.01.2009 19:23:39 von Octavian Rasnita

Hello,

Can perlscript be used to create .hta applications like the example below
which uses VBScript?

I have tried to make some replacements like:
txtFruit.Focus
->
$txtFruit->Focus();

but it gives an error telling that $txtFruit is not defined and a few other
errors.

Thank you.




Fruit Basket HTA demo
APPLICATIONNAME="FruitBasket"
BORDER="thick"
CAPTION="yes"
ICON="test.ico"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal"
SYSMENU="yes"
CONTEXTMENU="no"
windowState="maximize"

MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="yes">







style="width:150" >

onclick=addFruit()>
onclick=removeFruit()>







Octavian

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: hta

am 03.02.2009 18:53:20 von Glenn.Deans

Do you mean you want Perl to create the HTA text file or replace the
VBScript with Perl? Since the HTA is just a text file it can create one
on if you want, but it cannot be used within the HTA itself. The
browser cannot interpret Perl.

.................................
Kind regards
Glenn Deans
Architect
Siemens IT Solutions and Services
Urbana, OH USA

-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of
Octavian Rasnita
Sent: Friday, January 30, 2009 1:24 PM
To: activeperl@listserv.ActiveState.com
Subject: hta

Hello,

Can perlscript be used to create .hta applications like the example
below
which uses VBScript?

I have tried to make some replacements like:
txtFruit.Focus
->
$txtFruit->Focus();

but it gives an error telling that $txtFruit is not defined and a few
other
errors.

Thank you.




Fruit Basket HTA demo
APPLICATIONNAME="FruitBasket"
BORDER="thick"
CAPTION="yes"
ICON="test.ico"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal"
SYSMENU="yes"
CONTEXTMENU="no"
windowState="maximize"

MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="yes">







style="width:150" >

onclick=addFruit()>
accesskey="r"
onclick=removeFruit()>







Octavian

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: hta

am 03.02.2009 19:47:45 von Octavian Rasnita

Well, the browser can interpret PerlScript if perl is installed. Does it
work only in common html files and Web Scripting Host but not in .hta files?

Thanks.

Octavian

----- Original Message -----
From: "Deans, Glenn (IT Solutions US)"
To:
Sent: Tuesday, February 03, 2009 7:53 PM
Subject: RE: hta


> Do you mean you want Perl to create the HTA text file or replace the
> VBScript with Perl? Since the HTA is just a text file it can create one
> on if you want, but it cannot be used within the HTA itself. The
> browser cannot interpret Perl.
>
> ................................
> Kind regards
> Glenn Deans
> Architect
> Siemens IT Solutions and Services
> Urbana, OH USA
>
> -----Original Message-----
> From: activeperl-bounces@listserv.ActiveState.com
> [mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of
> Octavian Rasnita
> Sent: Friday, January 30, 2009 1:24 PM
> To: activeperl@listserv.ActiveState.com
> Subject: hta
>
> Hello,
>
> Can perlscript be used to create .hta applications like the example
> below
> which uses VBScript?
>
> I have tried to make some replacements like:
> txtFruit.Focus
> ->
> $txtFruit->Focus();
>
> but it gives an error telling that $txtFruit is not defined and a few
> other
> errors.
>
> Thank you.
>
>
>
>
> Fruit Basket HTA demo
> > APPLICATIONNAME="FruitBasket"
> BORDER="thick"
> CAPTION="yes"
> ICON="test.ico"
> SHOWINTASKBAR="yes"
> SINGLEINSTANCE="yes"
> WINDOWSTATE="normal"
> SYSMENU="yes"
> CONTEXTMENU="no"
> windowState="maximize"
>
> MAXIMIZEBUTTON="no"
> MINIMIZEBUTTON="yes">
>
>
>
>
>
>
>
> > style="width:150" >
>
> > onclick=addFruit()>
> > accesskey="r"
> onclick=removeFruit()>
>
>
>
>
>
>
>
> Octavian
>
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: hta

am 04.02.2009 00:42:17 von Jan Dubois

On Tue, 03 Feb 2009, Octavian Rasnita wrote:
> Well, the browser can interpret PerlScript if perl is installed. Does
> it work only in common html files and Web Scripting Host but not in
> .hta files?

> > Can perlscript be used to create .hta applications like the example
> > below which uses VBScript?
> >
> > I have tried to make some replacements like: txtFruit.Focus ->
> > $txtFruit->Focus();

PerlScript should work just fine inside HTA applications. You may need to access
the HTML elements through the DOM though, with something like $window->document->...

Sorry, can't be more specific, as I don't use HTAs myself. I found several examples
of HTAs mixing PerlScript and Jscript or VBScript in a single file, so I think it
does work, even if you can't directly access each other's global variables.

Cheers,
-Jan

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: hta

am 04.02.2009 07:37:27 von Octavian Rasnita

From: "Aaron Hawryluk"
> IF it's workable, you will need to make sure that the script syntax is
> converted to Perl. Structures like "If Not x Then y", while workable
> in VBScript, are either syntactically ambiguous or just plain don't
> work in Perl.
> In other words, just replacing Variable with $Variable and
> Object.Child with $Object->child isn't going to help you much. For
> example:
>
> If Not txtFruit.Value="" Then
>
> Needs to convert to:
> if($txtFruit->Value != ""){
> }

Of course I have also converted those lines.

> I'm also not 100% sure on the "txtFruit" id being automatically read
> in as $txtFruit in PerlScript, I think you would need to figure out
> how PerlScript accesses the DOM.

Well, exactly this is what I don't know. How can perl access the DOM. I found too little documentation about PerlScript in general, and that documentation and the sample files I found were very old, and most of the sample files don't even work.

> Again, that's if PerlScript can even
> run as a client-side scripting engine, which I'm not sure of. I've
> never tried running PerlScript on the client-side... does it run as an
> IE addon or something?
> And even beyond that, if you don't mind my asking, why write
> client-side code that would require the user to install an ActiveX
> scripting object just to work?

Because I don't know JScript nor VBScript and because creating a program in those languages would be much harder anyway.

Octavian

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: hta

am 04.02.2009 09:04:13 von Jan Dubois

On Tue, 03 Feb 2009, Octavian Rasnita wrote:
> Well, exactly this is what I don't know. How can perl access the DOM.
> I found too little documentation about PerlScript in general, and that
> documentation and the sample files I found were very old, and most of
> the sample files don't even work.

It's not an HTA file, but the OLE Browser I wrote almost 10 years ago
is all written in client side PerlScript inside an HTML file. Its
standard install location is:

C:\Perl\html\lib\Win32\OLE\Browser.htm

The main page of the browser has the same filename, but with a .html
extension instead of just .htm, but that file just defines the
frameset.

As I wrote in my previous message, you can access the document from
PerlScript via $window->document->xxx.

Cheers,
-Jan

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: hta

am 04.02.2009 10:52:11 von Octavian Rasnita

I have tried to open that file in IE6, but it gave the following error:

Internet Explorer could not load the PerlScript engine. This is most likely due to the value of the "Initialize and script ActiveX controls not marked as safe" security setting of the "Local intranet" zone. PerlScript inside IE will only run on Windows XP SP2 and later if this setting is set to Enable. Setting it to Prompt doesn't seem to work.

I have set that security option to "enabled", and I restarted the browser, but it doesn't want to work. It gives the same error.

I use ActivePerl 5.10.0 under Win XP SP3.

In a comment in that page I read that we need to use JScript until the PerlScript will be fixed. Does PerlScript really have a bug, or I could try to do something else to make it work.

I guess that if PerlScript doesn't work in that page, it won't work in a .hta file neither.

Thank you.

Octavian

----- Original Message -----
From: "Jan Dubois"
To: "'Octavian Rasnita'" ;
Sent: Wednesday, February 04, 2009 10:04 AM
Subject: RE: hta


> On Tue, 03 Feb 2009, Octavian Rasnita wrote:
>> Well, exactly this is what I don't know. How can perl access the DOM.
>> I found too little documentation about PerlScript in general, and that
>> documentation and the sample files I found were very old, and most of
>> the sample files don't even work.
>
> It's not an HTA file, but the OLE Browser I wrote almost 10 years ago
> is all written in client side PerlScript inside an HTML file. Its
> standard install location is:
>
> C:\Perl\html\lib\Win32\OLE\Browser.htm
>
> The main page of the browser has the same filename, but with a .html
> extension instead of just .htm, but that file just defines the
> frameset.
>
> As I wrote in my previous message, you can access the document from
> PerlScript via $window->document->xxx.
>
> Cheers,
> -Jan
>
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: hta

am 06.02.2009 07:52:12 von Sean Lin

Another solution,

Win32::GUI + Win32::GUI::AxWindow
GetOLE() from "Shell.Explorer" ActiveX Control




2009/2/4 Octavian Rasnita
>
> I have tried to open that file in IE6, but it gave the following error:
>
> Internet Explorer could not load the PerlScript engine. This is most likely due to the value of the "Initialize and script ActiveX controls not marked as safe" security setting of the "Local intranet" zone. PerlScript inside IE will only run on Windows XP SP2 and later if this setting is set to Enable. Setting it to Prompt doesn't seem to work.
>
> I have set that security option to "enabled", and I restarted the browser, but it doesn't want to work. It gives the same error.
>
> I use ActivePerl 5.10.0 under Win XP SP3.
>
> In a comment in that page I read that we need to use JScript until the PerlScript will be fixed. Does PerlScript really have a bug, or I could try to do something else to make it work.
>
> I guess that if PerlScript doesn't work in that page, it won't work in a .hta file neither.
>
> Thank you.
>
> Octavian
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs