Re: Is there a way to run Javascript in an Applescript script?
Re: Is there a way to run Javascript in an Applescript script?
- Subject: Re: Is there a way to run Javascript in an Applescript script?
- From: Axel Luttgens <email@hidden>
- Date: Fri, 15 Mar 2013 12:50:09 +0100
Le 15 mars 2013 à 12:18, Jim Brandt <email@hidden> a écrit :
> Is there a way to run Javascript in an Applescript script?
>
> I have an HTML document which used to have hard-coded dates in it in the form yyyy-mm-dd.
>
> Recently, the HTML code changed to use Javascript to display the dates, so the code now looks like this:
>
> <script type="text/javascript">tstamp = new Date(1363144928000);document.write(tstamp.toLocaleString());
>
> I would like to decipher this into the date it represents so I can use that date in my script. Is it possible to pass the string to Javascript and get the date back, either as a date variable or as a string that represents the date?
A quick guess first; could something like this one:
set D to (date "1/1/1970" + 1363144928)
be sufficient for your purpose?
Otherwise, are you fetching those documents with a navigator?
In which case, just make use of it; for example, Safari has the do JavaScript command.
Axel
_______________________________________________
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