Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Mac::AppleScript::Glue in CGI script

by Cody Pendant (Prior)
on Nov 13, 2004 at 08:44 UTC ( [id://407597]=note: print w/replies, xml ) Need Help??


in reply to Re: Mac::AppleScript::Glue in CGI script
in thread Mac::AppleScript::Glue in CGI script

I'm sorry not to have pointed out, I didn't just take the script above and try to run it as a CGI.

I printed a valid header and used CGI::Carp and that didn't help. It still died silently at the line noted.

Here's a script which works in the command-line and not in the browser:

#!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); print "Content-type:text/plain\n\n"; require Mac::AppleScript::Glue; print "started\n"; my $BB = new Mac::AppleScript::Glue::Application('BBEdit') || die "$!"; print "success creating Applescript Glue App object\n"; my $results = $BB->check_syntax(file => 'path:to:file') || die "$!"; print "success checking syntax\n";

It gets as far as the first success message, and then, if the file exists, just stops.

If I try it on a file which doesn't exist, then yes, I get a failure from AppleScript and CGI::Carp does its thing. But if there is a file at that location, then it just stops.

What can I investigate in terms of permissions?



($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
=~y~b-v~a-z~s; print

Replies are listed 'Best First'.
Re^3: Mac::AppleScript::Glue in CGI script
by saberworks (Curate) on Nov 13, 2004 at 09:13 UTC
    Take a dummy file, chmod it to 777, then point your script at it. 777 is world-writable so if it works you know you have a permissions problem. If it doesn't work then it's probably something else. Either way, delete the file after you run your tests.
Re^3: Mac::AppleScript::Glue in CGI script
by tachyon (Chancellor) on Nov 13, 2004 at 09:49 UTC

    In addition to the chmod 777 test file check you should switch debugging on. The syntax is a bit clunky but you do:

    $Mac::AppleScript::Glue::Debug{SCRIPT} = 1;

    Where SCRIPT can be SCRIPT,RESULT,PARSE,INIT,AUTOLOAD. This should get you more output if it is not a simple perms issue (which I still think it is). When you say stops there is stop and STOP! Is it hung or exited? Is it using 100% CPU or 0% cpu? Does it timeout eventually?

    cheers

    tachyon

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://407597]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-24 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found