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

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.
  • Found it! (Score:5, Informative)

    by pudge (1) on 2003.11.21 18:11 (#25979) Homepage Journal
    My happening script was causing the problem, though it is a bug in Terminal.app that is easily reproduced with AppleScript. Here's the bug report I am filing:
    * SUMMARY
    After sending an Apple event to Terminal.app, it ceases to open and execute .command files.
     
    * STEPS TO REPRODUCE
    1. Create an executable .command file on the Desktop:
     
      $ cd Desktop/
      $ cat > foo.command
      #!/bin/sh
      echo "hi"
      ^C
      $ chmod a+x foo.command
     
    2. Quit Terminal.app
    3. Double-click foo.command in Finder
    4. See that Terminal.app opens, makes new window, and executes the script
    5. Make a new Terminal.app window, and execute this command:
     
       $ osascript -e 'tell app "Terminal" to activate'
     
    6. Double-click foo.command in Finder, again
    7. See that Terminal.app activates, but does not make new window, or execute script
     
    * NOTES
    FWIW, every AppleScript (actually, I discovered this sending Apple events to Terminal.app from Perl using Mac::Glue, but osascript is a lot easier for the sake of the bug report) I tried to use with Terminal.app cause the problem.  Activate, get property, whatever.
     
    Also, I've confirmed the script does not run, by making the .command script do something verifiable (like making a new file).  It's not merely that you don't see it running, it actually isn't running.
    So if you use happening under Panther, you may want to comment out the "extra info about Terminal" stuff.
  • My happening script was causing the problem [...]

    That's an interesting way to characterize your script!

    So if you use happening under Panther [...]

    Ah, the light begins to dawn. What's happening?

    (Personally, I like to give my scripts names like what and nothing - What's running? - Yes. - etc.)
    • happening [macperl.org] is a little script I use to set my iChat status. Primarily, it shows my current application, and what is on iTunes, but it can do all sorts of things. It can show what is playing on EyeTV, it can show the current window in an app or the current process in Terminal.app, or the current channel in IRC, whatever.