Skip to Content

Submit your nominations for the Luxist Awards' Best in Decor
AOL Tech

scripting posts

Filed under: Enterprise, Software, Internet Tools, Developer

Yuma: New scripting tool for web developers

YumaTo web developers, scripting is the glue that connects web pages and back-end systems. For example, PHP is a very popular scripting environment that has been used to write web apps like WordPress and phpBB. For those of you who use PHP, you know that it is a dynamic, weakly-typed hypertext preprocessor. In other words, it's a scripting language that is embedded in the HTML code that makes up a web page.

Inspiring Applications, Inc. hopes to catch the imagination of web developers with Yuma, their new strongly-typed, object-oriented scripting tool that is being released today. Rather than the confusing syntax of PHP, Yuma uses a simple REALBasic-like syntax. It is natively compiled to machine code on Mac OS X, Linux, and Windows for high speed.

Yuma Development Server for Mac OS X is available as a free download, complete with example code, a full developer reference, language definition files for BBEdit, TextMate and Text Wrangler, and more. When you're ready to deploy your Yuma web app, you can purchase and install Yuma Enterprise Server ($149). It's a command-line app and may be set up as a daemon.

To run either Yuma Development or Enterprise Server on Mac OS X, you need to be running OS X 10.3 or later on a G4, G5, or Intel-based Mac with at least 1 GB of RAM.

Thanks to Brad for the tip.

Filed under: Features, How-tos, AppleScript

AppleScript: Integrating shell scripts


We've talked about AppleScript how-tos before. AppleScript is fun and all, but what if you already know how to write shell scripts? Well, did you know that by integrating shells scripts into AppleScript, you can create simple applications that do useful things? It's true, and I am going to show you how.

Continue reading to learn how to integrate shell scripts into AppleScripts.

Continue readingAppleScript: Integrating shell scripts

Filed under: Features, Tips and tricks

Speedy creation of rich text links to Mail messages

If you use any applications with Cocoa-based text editors (TextEdit, Mail.app, and many more), you may have noticed that some of them, like Mail.app, recognize URLs and automatically turn them into links. The links are in Rich Text Format (RTF) and can be copied and pasted into other RTF-compatible text fields. To the best of my knowledge, though, there's no easy way to automate the creation of an RTF hyperlink, via AppleScript or other means. In programs that don't detect URLs, or if you want to link text to a URL, you generally have to select text, go to a menu item (Link..., Link Add..., etc.) that's a few submenus down, and then enter the url. Me? I'm always looking for the easy way out...

Continue readingSpeedy creation of rich text links to Mail messages

Filed under: Software, Tips and tricks, Developer, iPhone

Create your own iPhone remote application

One of the good things about the "very sweet solution" of iPhone development is that you don't need any special tools or too much knowhow to create neat applications-- if you know a little HTML, a little PHP, and have access to a text editor, you can come up with some pretty cool stuff. This tutorial from IBM's DeveloperWorks is about as simple as it gets, and yet it shows you how you can use your iPhone as a remote for iTunes, Keynote, or any other AppleScript-able applications on your Mac, with no jailbreakin' necessary.

Of course, as he mentions at the end, Telekinesis did most of this stuff early on, so if you've got something standard that you want to do (like control iTunes), you don't need to write the code yourself any more. But combine the tutorial with any other custom AppleScripts you've written (or might write), and a lot of possibilities open up in terms of what you can do with your computer, straight from your iPhone.

[ via MacBytes ]

Filed under: Hacks, How-tos, iPhone

Trick your iPhone voicemail into using voice recording data

The other day, I discussed how to record audio on your iPhone. Several people wrote in asking whether they could have their recordings show up in voicemail, so I scouted around a bit. I discovered that voicemail is stored in ~/Library/Voicemail and that it uses an sqlite3-compatible database to manage that information.

Last night, I put together a shell script that allows you to trick the iPhone into thinking that amr files added to the voicemail folder are actual voicemails. To make this happen, I ported sqlite3 to the iPhone (You can download a copy here). I also wrote a csh script, which you can download here and a time utility, here. The reason I wrote the script in csh rather than bash (both of which appear in the standard binary distribution kit) is just that I'm more familiar with csh.

To run the script, supply it with the amr file as its one argument, e.g. copy2vmail foo.amr. The script copies the amr file to the voicemail folder and updates the voicemail database as if the voicemail were received at the current time.

To force voicemail to update and re-read the database, enter the phone application and quit it by holding down the home button for 4-8 seconds. Re-enter the phone application and, with luck, you will see the recording as new voice message from "VoiceRecorder".

Thanks, Spaced.

Filed under: Productivity, Tips and tricks, Odds and ends, Developer

Open man pages from Xcode

Toxic Software's posted a useful little script if you spend any amount of time in Xcode-- because manopen is having trouble with Leopard, John punched up a shell/Applescript to open man pages directly from within Xcode's command line. It's tiny (and doesn't really do much-- just opens an Xcode Help menu item), but it seems useful-- straight from the command line, you can break out the man page within a GUI, and just keep right on coding.

Because the script uses UI scripting, you've got to enable an option in Universal Access preferences, but then just toss the script in your PATH and you're good to go. I can't imagine it's hugely relevant for everyone out there (I haven't put anything together from the command line in Xcode in a while), but anyone building stuff there will probably appreciate it.

And if viewing pretty man pages from the command line is your thing, Atomicbird Software came up with a script that breaks out man pages in PDF form. If you love working from the command line but love reading man pages in something a little easier to browse, today's your lucky day.

Filed under: Software, Productivity, Internet Tools

PackRat 1.1 adds AppleScript and Automator support

Someone must have answered Rod Schmidt's call for AppleScripters, as he has just released PackRat 1.1, a major update to his offline Backpack syncing app that brings double-whammy support for both AppleScript and Automator. You can now get almost all your Backpack data via script, which means power users can do all sorts of extra-cool nerdy things now. A 'Synchronize with Backpack' Automator action is also included, offering easy access for the rest of us to set up auto-downloads in the morning or before we leave for a trip (hint: run the action as an app attached to an iCal event).

Check out Rod's announcement post for more details and to download a copy of the new PackRat version. As usual, PackRat will function as a non-expiring demo that allows working with 4 pages, while a license costs $24.95.

Filed under: How-tos, iTunes, Terminal Tips

Terminal Tip: "Now Playing" info from the command line

Have you ever wondered whether there was a command line way to check iTunes and determine which song is currently playing. The command-line osascript utility makes this an easy problem to solve. Osascript executes AppleScript commands from Terminal's command line and can run many of the same kinds of simple scripts you'd normally run in Script Editor. Here's a quick how-to to build a Now Playing command line utility.

  1. Launch Terminal.
  2. In Terminal, enter: touch nowplaying
  3. In Terminal, enter: open -e nowplaying
  4. In TextEdit, paste the following into nowplaying. The second line wraps here but should copy and paste correctly--at least it did when I tried it out.
    #! /bin/bash
    osascript -e 'tell application "iTunes" to if player state is playing then "Now Playing: " & name of current track & " - " & artist of current track'
  5. Save the file in TextEdit and close it.
  6. In Terminal, enter: chmod 755 nowplaying
  7. Open iTunes and start playing a song.
  8. In Terminal, enter: ./nowplaying

The script, when run, outputs the track name and artist.

% ./nowplaying
Now Playing: Everything I've Got - Iain Archer
%

Thanks Dave M

Update: For those of you who don't want to keep iTunes open:
#! /bin/bash
osascript -e 'tell application "System Events" to if ((name of processes) contains "iTunes") then do shell script ("osascript -e " & quoted form of ("tell application \"iTunes\" to if player state is playing then \"Now Playing: \" & name of current track & \" - \" & artist of current track" & ""))'

Filed under: Software, Productivity, Internet Tools

PackRat dev calls for AppleScripters

Rod Schmidt, developer of PackRat, has issued a call for AppleScripters who are interested in automating his rocking Backpack client. PackRat, to my knowledge, doesn't have AppleScript support yet, but that does seem to be at the top of the request list and would mark another powerful feature PackRat has over Backpack's own web UI: OS integration. I would love to be able to, for example, right-click some selected text in a Cocoa app and click "Send to PackRat," which would then sync up to Backpack all without me ever having to touch an actual webpage.

If you have some AppleScripting skills and are interesting in making PackRat even cooler, be sure to drop Rod a line by heading over to his announcement post or contacting him from his company's site, infiniteNIL.

Filed under: Software, TUAW Tips

TUAW Tip: enable the AppleScript menu

As I was working on an AppleScript-related post this morning, I couldn't seem to find any TUAW Tips in our vast archives that explained how to enable that AppleScript menubar item (pictured) that is mentioned so often in Mac software circles. This, of course, called for just such a tip.

So: the AppleScript menubar item. It's a very handy tool for accessing all those AppleScripts you hear about that automate this or toggle that. As long as you save those scripts in ~/Library/Scripts (where ~ is your Home folder), they'll appear in this AppleScript menu - once you've enabled it. I personally think this menu item should be included in the default set of every Mac, but I'd wager that Apple sees this as a little too nerdy of a feature to drop on brand new users. Fair enough.

To enable this menu (nerd) in Tiger, go to /Applications/Applescript and open the AppleScript Utility. It offers a few options for handling AppleScripts, including turning on this menu and the order in which the menu displays scripts from both the default system level /Library/Scripts (in your main hard drive) and your personal ~/Library/Scripts folder. If you're on 10.3 (Panther), I *think* you have an /Applications/AppleScript folder, but instead of a full-blown AppleScript Utility app, it's an AppleScript called 'Install Menu' or something similar. Back on Tiger in the AppleScript Utility - you don't worry about the GUI Scripting option unless you come across a script that specifically needs it, though I don't think enabling this for simplicity's sake can harm anything either.

If this process went according to plan, you should now have your very own AppleScript menubar item like I have in the screenshot here. clicking it will offer a simple menu of all the scripts you have between the two directories you chose to display. As long as you enabled your personal Home script directory, any scripts you save there should appear in this menu immediately after saving, ready to carry out your bidding.

With that said, why not check out some of our past AppleScript posts, such as one of my personal favorites: an AppleScript from Fraser Speirs that opens iSync, syncs all your devices (such as a phone or PDA), then quits iSync. If you use an application launcher such as Quicksilver, you can tie handy scripts like these to Triggers (system-wide keyboard shortcuts) for even more convenience.

Filed under: Software

Griffin releases Proxi 1.0

Back in April we wrote about the public beta of Proxi, which is the easy-to-use scripting software from Griffin Technology. Proxi lets you automate complicated routines, much like Automator or QuicKeys. Earlier this week, Griffin released version 1.0 of Proxi.

Changes to version 1.0 include support for the following triggers and tasks (among others):
  • Griffin AirClick (as well as several other Griffin devices)
  • Applescript
  • iTunes monitor
  • iChat monitor
  • Mail monitor
  • Growl notification
  • Open file
  • Open URL
  • Write to file
Proxi requires Mac OS 10.4 or later, is free and universal.

Filed under: Software

FastScripts Lite

FastScripts is a menubar script launcher on steroids. It offers up everything the Apple version does, and a whole lot more. It also happens to cost $15, which is a fair price for the application but some people might balk.

Balk no more, because FastScripts Lite has been released and it is available at everyone's favorite price point: free. There are some limitations but I think that the developer has been very generous with the functionality that is included in this free version.

Tip of the Day

Use Spotlight as a reference tool. Type any word in the Spotlight box and one of the top entries will be a definition. Click on it, and it will bring up the dictionary application to check the word in either the dictionary, thesaurus, Apple database, or Wikipedia.


Follow us on Twitter!
 TUAW [Cafepress]

Featured Galleries

DNC Macs
Macworld 2008 Keynote
Macworld 2008 Build-up
Google Earth for iPhone
Podcaster
Storyist 2.0
AT&T Navigator Road Test
Bento for iPhone 1.0
Scrabble for iPhone
Tom Bihn Checkpoint Flyer Briefcase
Apple Vanity Plates
Apple booth Macworld 07
WorldVoice Radio
Quickoffice for iPhone 1.1.1
Daylite 3.9 Review
DiscPainter
Mariner Calc for iPhone
2009CupertinoBus
Crash Bandicoot Nitro Kart 3D
MLB.com At Bat 2009
Macworld Expo 2007 show floor

 

More Apple Analysis

AOL Radio TUAW on Stitcher