Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Using Web Services with Perl and AppleScript

posted by pudge on 2002.09.25 7:12   Printer-friendly
jonasbn writes "An article on Perl, AppleScript, and Web Services by Randal L. Schwartz has been published on O'ReillyNet." See AppleScript and Perl work together!
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • It's an interesting article about how AppleScript and Perl can work together; my only issue with it is that it implies that "full access" to Perl was not available in Macs prior to Mac OS X, despite that the Perl he provides works flawlessly in Mac OS, as most Perl does.

    The AppleScript, however, does not (yes, one could say Perl is more portable than AppleScript, even between Mac OS and Mac OS X :-). But, if you really want to, you can change "localhost" to your IP address in both scripts (Mac OS has issu
    • I always found I had everything I needed with MacPerl. It even came with lots of extra goodies you didn't get with the standard distribution.

      I first installed MacPerl on our Mac LCIII in 1998 (about four months after I learned Perl). It quickly became the only programming language I used on the Mac. It was also the first Perl 5 I ever used. (We were still on 4 at work at that point.)

      I wrote my first LWP program with MacPerl sometime in 2000/2001. To my shame, I've never installed one of the more re

      --
      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
    • Well yes, in defense, there was a nice edit applied to my original text, as always. So some of the tone was changed. That's typical.

      The article was to show the SOAP interface. Certainly, I'd personally write the entire thing in Perl, except that I'd have to call

      system 'osascript', '-e', "open $htmlfile";

      to launch the user's preferred browser, and perhaps to get the temporary area if I didn't just want to use /tmp.

      However, the SOAP interface between the AS side and the Perl side was very nice. Th

      --
      • Randal L. Schwartz
      • Stonehenge
      • Yes, you'd need to use osascript (for now ... my evil plans include fixing that, someday) or simply the "open" command line program. Although, you could try PerlObjCBridge.pm, but I have no idea how to do it that way. Also, you could access the Temporary Items directory using Carbon (and possibly Cocoa) calls, but yeah, same thing. Or you could use Inline. Wheeeee!

        I do realize that it was more just an example of interaction, and not "you should do it this way," I was pointing this out merely because th
        • > * There is no such thing as "OS9". I don't care if you think I am being overly pedantic. :p

          But there is... though not for Apple :-)

          I know of at least OS9 for MC6809 based computers. It's vaguely UNIX-like multitasking multiuser OS [clara.net], used for example in the Dragon [clara.net] microcomputer. I I think remember people running BBSes on top of this.

          Then there was OS9 [f9.co.uk] for the Sinclair QL [soft.net.uk] and the BBC Micro [nvg.ntnu.no], of which I know little. I *think* this was one of the 80's "BASIC OSes".

          • Yeah, exactly! This is my problem with this stuff. OS9 is something else, and I quite honestly have no idea half the time when someone says "I can't get this program to work under X." Grrrrr. :-)
        • I don't care if you think I am being overly pedantic. :p

          Hehe; you're not cut from the same cloth as RMS [gnu.org], are you? ;)

          --
          J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
        • Script Editor opened TextEdit (not my browser ... that part was weird).
          Perhaps this problem is related to the Creator Type of the "HTML" file?

          I would think, MacOS-X being more Unix-like than MacOS9, that the former checks out the file's extension. But that notion is unknown under earlier MacOSes.

        • Although, you could try PerlObjCBridge.pm, but I have no idea how to do it that way.

          You'd want to use NSWorkspace, but I'm not sure if PerlObjCBridge wraps AppKit classes - I had the impression that it didn't. Here's how you'd do it in CamelBones:

          NSWorkSpace->sharedWorkspace->openFile($htmlfile);
      • personally write the entire thing in Perl, except that I'd have to call
        system 'osascript', '-e', "open $htmlfile";
        to launch the user's preferred browser, and perhaps to get the temporary area if I didn't just want to use /tmp.

        Nah. Just use Mac::AppleScript instead.