html> Emmanuel M Décarie's weblog on scripting. [Archives]

Emmanuel M Décarie's weblog on scripting.
Mostly PHP, Radio UserLand, Perl, Applescript and OS X.
RSS/XML Feed | | Picture | Search
Categories: AppleScript | BBEdit | Internet | Javascript | OS X | Perl | PHP | Python | Review | Radio UserLand
Technorati URL search for
Search Technorati for information relating to the URL or keyword of your choice.
... Original post: Emmanuel M Décarie's weblog on scripting. by at Daypop Search - filter replacement ...
Filter Replacement View Technorati URL search


Fri 28 Feb 2003

Fun with the OS X Terminal

Some interesting stuff to do from the terminal found on the Mac OS X Perl mailing list.

Chris Devers: Finding info on OS X

% sw_vers
ProductName:    Mac OS X
ProductVersion: 10.2.4
BuildVersion:   6I32

% hostinfo
Mach kernel version:
	 Darwin Kernel Version 6.4:
Wed Jan 29 18:50:42 PST 2003; root:xnu/xnu-344.26.obj~1/RELEASE_PPC

Kernel configured for up to 2 processors.
1 processor is physically available.
Processor type: ppc750 (PowerPC 750)
Processor active: 0
Primary memory available: 320.00 megabytes.
Default processor set: 91 tasks, 185 threads, 1 processors
Load average: 1.06, Mach factor: 0.00

% uname -a
Darwin barney 6.4 Darwin Kernel Version 6.4: Wed Jan 29 18:50:42 PST 2003;
root:xnu/xnu-344.26.obj~1/RELEASE_PPC  Power Macintosh powerpc

Ken Williams & Paul McCann: Revealing a file in the Finder from the terminal

my $file = shift or die "No file specified";                                    
use File::Spec;                                                                 
$file = File::Spec->rel2abs($file)                                              
  if !File::Spec->file_name_is_absolute($file);                                 
system(qq{osascript <<END 
tell application "Finder"
reveal "$file" as POSIX file as alias 
end tell

Jonathan King: running Software Update

Note: the example is from me.

% /usr/sbin/softwareupdate
Software Update Tool
Copyright 2002 Apple Computer, Inc.

Software Update found the following new or updated software:

  - AirPortSW-2.1.1
        Logiciel Airport (2.1.1), 4350K - restart required
  - iPod-1.2.1
        Logiciel iPod (1.2.1), 5712K

To install an update, run this tool with the item name as an argument.
        e.g. 'softwareupdate <item> ...'

Adam Wells: System Profiler

Note: the example is from me.

% /usr/sbin/system_profiler


    Software Overview:
      System version: Mac OS X 10.2.4 (6I32)
      Kernel version: Darwin Kernel Version 6.4: Wed Jan 29 18:50:42 PST 2003;
      [long listing following] 


comments: 0

3:41PM EST [ /OSX | # ]

Thu 20 Feb 2003

Quick Links

appswitch 1.0, a command-line interface to the Mac OS X process manager.

IC-Switch is a helper utility for Internet Config (hence the "IC" in its name), for Mac OS X only.

Ranchero Software:

Huevos 1.1b3 A new beta of the open source Huevos search application has been released.

NetNewsWire Lite 1.0.3b2 A new beta of the Lite version of NetNewsWire was released today--it includes a bunch of bug fixes and some new features that come from the full version.

NetNewsWire 1.0.1b1 This first post-1.0 beta version includes brand-new XML-RPC code.

Grumpicus Maximus: How NOT to design a comments server (Radio UserLand)

David Sklar: Custom Error Pages with PHP and Apache (O'Reilly OnLamp)

comments: 0

12:05AM EST [ /OSX/QuickLinks | # ]

Wed 19 Feb 2003

hierarchical notebook (hnb)

From the web page:

hierarchical notebook(hnb) is a curses program to structure many kinds of data in one place, for example addresses, todo lists, ideas, book reviews or to store snippets of brainstorming. Writing structured documents and speech outlines.

The default format is xml but hnb can also export to ascii and html. External programs may be used for more advanced conversions of the xml data.

What is interesting is that it can handle OPML files.

Support for importing and exporting OPML files were added today, the support is very basic at the moment. But I don't know how much support is required to make it useful.

To load a opml file enter hnb --opml file.opml , or hnb -o file.opml .

Now I feel quite stupid, because I can't install it on OS X (I can't find the configure file). I'm sure I'm missing something here.

More: [via Karl Dubost]

comments: 0

11:03AM EST [ /OSX/Utilities | # ]

Tue 18 Feb 2003

Matt Neuburg: Multiple Clipboards on Mac OS X

Matt review three utilities for managing the OS X clipboard:


comments: 0

9:05AM EST [ /OSX/Utilities | # ]

Thu 13 Feb 2003

Converting Text from Scripts: MacRoman/ISO-8859, Text/HTML

Here's some free applications, osaxen and scripts that I know off that will help you for converting text in your scripts.

Standalone Apps

HTML Converter 2.0

From the web page:

HTML Converter is a free utility for converting special characters to corresponding HTML character codes (for example '©' -> '©' or '"' -> '"') in HTML, PHP and ASP files. These character codes are required by web browsers for displaying special characters correctly. HTML converter will also handle correctly JavaScript and Cascading Style Sheet code.

Cyclone 1.5.2

From the web page:

An Interface for Apple Text Encoding Converter.
Macintosh, Unicode, ISO, DOS, Windows, and other encodings

Frontier/Radio UserLand (not free)

Here's a couple of pointers to

string.iso8859encode (s, adrTable): Encodes characters as HTML entities.

string.latinToMac (s): Converts text from Latin (Windows) to Macintosh.

string.macToLatin (s): Converts text from the Macintosh to the Latin (Windows) character set.

Scripts and Osaxen

TEC Osaxen

From the web page:

Convert between text encodings throught Apple's Text Encoding Converter.

Commands: styledText2Unicode, styledTextFile2Unicode, tecConvertText, tecGetEncodings, tecGetSniffers, tecSniffTextEncoding, textClipping2Unicode, unicode2StyledText, unicode2StyledTextFile, unicode2TextClipping.

Perl Character Set Conversion Scripts

From the web page:

This is a collection of short scripts to convert data between different character encodings. Currently supported are Macintosh to ISO-8859-1, ISO to Mac, ISO to UTF-8, UTF-8 to ISO, Mac to UTF-8 and UTF-8 to Mac.

comments: 0

1:24PM EST [ /OSX | # ]

Dev Guides - Developing on Mac OS X

A thorough listing of all available IDE that you can use on OS X to build apps [via Studio Log]. All IDE coverered have screen shots, useful links and a feature matrix. Here's some IDE listed.

More: Dev Guides - Developing on Mac OS X

comments: 0

12:26PM EST [ /OSX | # ]

Tue 11 Feb 2003

NetNewsWire 1.0!!!

NetNewsWire 1.0 is shipping. This is an incredible well done app for reading RSS feeds. Its elegant, well thought, and for anyone working with RSS on OS X, an incredible tool.

Two features that I like the most. The contextual menu that offer a bunch of essential commands. And the nice attention to details in the interface.

Get it now! $29.95 introductory price.

I could add the that the third features is that it comes from Brent Simmons, one of the nicest guy that I know on the net.

comments: 0

5:34PM EST [ /OSX | # ]

TidBITS: A Mac User's Guide to the Unix Command Line, Part 2

Kirk McElhearn continue its series on the introduction of Unix in TidBITS with A Mac User's Guide to the Unix Command Line, Part 2 [via TidBITS]

Lesson 2: Navigating the File System

In the first installment of this series, we looked at the basics of using the Terminal to access Mac OS X's Unix core. What's next? Well, when you visit a new place, the first thing you need to learn is how to get from one location to another. So, let's look this time at how you use the Terminal to move around your Mac's file system. (You might want to go back and read the previous article again to refresh your memory before continuing.)

comments: 0

9:27AM EST [ /OSX | # ]