I’m tossing an early-morning project out there for anyone who might find it useful. It was inspired by a quick tip via OneThingWell. It lets you pop up LaunchBar, type in a Sparkup format string and create a temporary playground (with jQuery loaded) in Chrome. You can then use the inspector to modify elements and test out jQuery.
This should really be done with JSFiddle, of course. It was just an experiment to see what was possible. I often find myself creating quick HTML structures in this way for testing out an idea, though, and it doesn’t require an internet connection. It’s just a really fast way to set up a playground. I think it has a place.
To run it, just unzip and drop the scptd
file in ~/Library/Application Support/LaunchBar/Actions
. Pop up LaunchBar and type “jq” or however many letters it takes to get the action to show up, then hit space. Type in a string such as “div#main>ul.nav>li*6>a{link}” and you’ll get an html page in your current Chrome tab with a #main div and an unordered list with a class of “nav” and 6 links. Open the Web Inspector (I) and you’re good to start playing. It adds a simple body *
rule with some background color and padding just to save me some time. You can adjust that in the embedded Python script.
You can easily modify this to work with Safari by editing the main script in AppleScript Editor. You should just be able to change “Google Chrome” to “Safari,” but I haven’t tested yet.
jQuery Fiddler v1.1
Create a temporary HTML structure with jQuery loaded in a browser tab from LaunchBar
Published 01/31/13.
Updated 01/31/13. Changelog