Tag Archives: JavaScript

WSH JavaScript Includes

Originally published on: Wed, 28 Apr 2010 00:09:54 +0000 I like to separate JavaScript functions into libraries that I can later reference in some other script. It’s easy enough to reference these in HTML using the SRC attribute of the … Continue reading

Posted in Programming | Tagged | Leave a comment

Embedding JavaScript in a Batch File

Originally published on: Fri, 07 Aug 2009 12:05:51 +0000 The program below is both a batch file and a JavaScript WSH console file. The dual nature of the file is achieved via JavaScript block comments and the strategy by which … Continue reading

Posted in Programming | Tagged | 2 Comments

A BBCode Tag to Display Temperatures in Celsius and Fahrenheit

Due to dramatic weather conditions in some parts of the U.S. at this time, the temperature often comes up in message-board conversations.  As some participants are used to referring to Celsius measurements and others are used to referring to Fahrenheit … Continue reading

Posted in Computers, Programming | Tagged , , , , | Leave a comment

Evaluate External JavaScript Files in Yosemite

In my recent post https://lawlessguy.wordpress.com/2014/10/22/javascript-libraries-in-yosemite/, I lamented about the way the Library() function behaves.  I put together a crude hack that helped to achieve something very close to what I had envisioned, but the approach is just too messy. Tonight, I … Continue reading

Posted in Programming, Uncategorized | Tagged , | 2 Comments

Using Standard C Libraries with Yosemite JavaScript

The documentation at https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html indicates that a number of standard C / Objective-C libraries may be used in JavaScript via the ObjC.import() mechanism. Please consider the following short program: Here’s what the program looks like when run from osascript ( note that … Continue reading

Posted in Programming | Tagged , | Leave a comment

JavaScript Libraries in Yosemite

(Please note: I think I found a more palatable way to accomplish what I wanted.  Please also see https://lawlessguy.wordpress.com/2014/10/25/evaluate-external-javascript-files-in-yosemite/ ) I’d like to begin by saying that I didn’t expect this exercise in learning OS/X JavaScript to take me down … Continue reading

Posted in Programming | Tagged , | 1 Comment

Command Line JavaScript in Yosemite

After running JavaScript from the Script Editor, I tried to run a script via Terminal as I had done before with AppleScript programs. I started with a simple “Hello, world!”-ish program in the Script Editor. I saved the program.  I … Continue reading

Posted in Programming | Tagged , | 2 Comments

Text to Speech, Yosemite, and JavaScript

I’d been waiting for the formal release of Yosemite so that I could play with JavaScript “automation”.  While tinkering I noticed a simple enough interface to the text-to-speech functions of OS/X. As an early sample program, I wrote a little … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Hide the HTTP-Referer using HTML and JS

Here’s a static HTML / JS page that you can use when you compose links to other sites if you wish to protect the address of the document that refers tp those links. redir.htm If you stage this document on … Continue reading

Posted in Programming | Tagged , | 2 Comments

Rainy Day Fun with the HTML DOM

All HTML and JavaScript code in this article is copyright 2012 by Jim Lawless under the MIT/X11 source code license. See: http://www.mailsend-online.com/license2012.php … I like to tinker with JavaScript and the HTML DOM. Tonight, I decided that I wanted to … Continue reading

Posted in Technology | Tagged , | Leave a comment