Re: Execute Javascript on an HTML file
Re: Execute Javascript on an HTML file
- Subject: Re: Execute Javascript on an HTML file
- From: Emmanuel LEVY <email@hidden>
- Date: Sat, 27 Apr 2013 13:56:42 +0200
Maybe you can do whatever you want with XMLLib and Satimage.osax, and include them into your app.
Best,
Emmanuel
On Apr 27, 2013, at 12:22 AM, Jim Skibbie wrote:
> Paul-
>
>
> This has some real potential! I like that it is a single binary with no
> dependencies, so I could tuck the whole phantomjs into my Applescript
> application and call it internally.
>
> My goal was to find something that didn't require maintaining an
> environment on multiple workstations to get my task accomplished.
>
> Thanks for the link. I will definitely check this out.
>
> On 4/26/13 4:35 PM, "Paul Scott" wrote:
>
>> Maybe http://phantomjs.org/ would help.
>>
>> Paul
>>
>> On 4/26/2013 2:11 PM, Paul Scott wrote:
>>> On 4/26/2013 1:36 PM, Jim Skibbie wrote:
>>>> I was hoping someone might know of a way to interact with an
>>>> underlying Javascript framework that could be executed to get the
>>>> same result without having to utilize the Safari browser.
>>>
>>> I don't have a good answer, but I want to point out that Javascript by
>>> itself doesn't buy you anything you couldn't do in another language,
>>> even AppleScript.
>>>
>>> Javascript becomes useful in a web browser by virtue of the DOM tree
>>> and the globals‹methods and objects‹provided by the web browser.
>>> Without that, Javascript has to parse the HTML the long hard way. Has
>>> anyone written an HTML parser in Javascript? That's a large exercise
>>> for such a small user base, given that most Javascript dealing with
>>> HTML runs in a browser, which gives you the DOM for free. And even
>>> then you'd still have to provide a container for your Javascript that
>>> gives you access to the document.
>>>
>>> You could, of course, use the V8 engine in a native
>>> application‹callable from AppleScript‹that provides access to the
>>> document, but again, you'd have to parse the HTML yourself. Perhaps
>>> there's some open source stand-alone container (possibly employing V8)
>>> available that doesn't render anything but provides a DOM and
>>> Javascript. That seems like a useful tool, actually; at least for your
>>> purposes.
>>>
>>> Paul
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden