Saturday, July 4, 2020

#1 2002-04-22 08:01:19 am

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

applescript from within OS X perl causes an error

Hello,
I am running an applescript from within a perl via Apple's osascript command line utility, which is nicely bundled into the perl module OSXMacPerl. Anyway, this allows me to plop a blob of applescript code right into my perl script and it is then executed on the fly. Here's the script:

Applescript:

tell application "FileMaker Pro"
activate
go to window " Title Database"
do script "Automated Export"
go to window "Subjects"
do script "Automated Export"
go to window "Contributors"
do script "Automated Export" end tell (Yes there is supposed to be a whitespace in the title of the first window.)

Pretty simple. It work fine when I run the perl script from an interactive shell or from within BBEdit. However, when I run it as a cronjob, the applescript component fails. Applescript reports the following error: "Application isn't running." It then sits there, eating up 77% of the CPU, doing absolutely nothing at all. Filemaker is, of course, running.
Has anyone else tried cronning an applescript? cronning a perlscript containing an applescript? anything even remotely like this?
tia!
Ben


One mans trash is another mans treasure


Filed under: FileMaker

Offline

 

#2 2002-04-22 09:27:57 am

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

Re: applescript from within OS X perl causes an error

Problem solved. For everyone's knowledge:
Perl was a non-issue. The problem was that the terminal-less cron program cannot run applescripts using osascript. One has to use the "open *" command with a pre-compiled script. It's ugly, but it works.

For more info, see: http://forums.macnn.com/cgi-bin/ultimat … 1&t=001670
Ben


One mans trash is another mans treasure

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)