Slash Boxes
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 ]

pudge (1)

  (email not shown publicly)
AOL IM: Crimethnk (Add Buddy, Send Message)

I run this joint, see?

Journal of pudge (1)

Friday November 21, 2003
05:05 PM and .command Files in Panther

[ #15931 ]

.command file support is broken for me in Panther.

I have a command file on my Desktop, call it "foo.command". is not running. I double click it, it launches, it runs the command in a new window. Fine. I do it again, fine. As much as I want to, keep doing it, it works.

But then ... it stops working. For no reason. I try again 20 seconds later, and it no longer works. I click, but no window opens. I don't do anything but simply wait. What is UP?

I even completely removed my file, so it is not my prefs, it seems. What is UP?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
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 that is easily reproduced with AppleScript. Here's the bug report I am filing:
    After sending an Apple event to, it ceases to open and execute .command files.
    1. Create an executable .command file on the Desktop:
      $ cd Desktop/
      $ cat > foo.command
      echo "hi"
      $ chmod a+x foo.command
    2. Quit
    3. Double-click foo.command in Finder
    4. See that opens, makes new window, and executes the script
    5. Make a new window, and execute this command:
       $ osascript -e 'tell app "Terminal" to activate'
    6. Double-click foo.command in Finder, again
    7. See that activates, but does not make new window, or execute script
    * NOTES
    FWIW, every AppleScript (actually, I discovered this sending Apple events to from Perl using Mac::Glue, but osascript is a lot easier for the sake of the bug report) I tried to use with 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 [] 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, or the current channel in IRC, whatever.