|
|
Simple PHP problem?
|
|
|
|
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status:
Offline
|
|
I have a line in my PHP script:
exec('osascript /Library/Scripts/Info\ Scripts/Current\ iTunes\ Song.scpt');
It seemed to work once, but it hasn't since. Any ideas? I can run this same command from the terminal just fine...
|
Scott Genevish
scott AT genevish DOT org
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Oct 2001
Location: London
Status:
Offline
|
|
PHP is being run by the user WWW - not you - so it fails when it is run - WWW is not logged in through LoginWindow - and therefore cannot use AppleScript.
(as far as I remember)
|
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status:
Offline
|
|
Originally posted by Diggory Laycock:
PHP is being run by the user WWW - not you - so it fails when it is run - WWW is not logged in through LoginWindow - and therefore cannot use AppleScript.
(as far as I remember)
Good thinking, but I tried:
sudo -u www osascript /Library/Scripts/Info\ Scripts/Current\ iTunes\ Song.scpt
...from the command line, which runs the command as the www user and it worked. I'll try turning on error checking...
|
Scott Genevish
scott AT genevish DOT org
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status:
Offline
|
|
OK Diggory, you were essentailly right. The error is:
INIT_Processeses(), could not establish the default connection to the WindowServer
It's related to the fact that the user that Apache runs as, www, does not have a windowserver running, which Applescript needs. Any workaround for this?
Thanks,
-Scott
|
Scott Genevish
scott AT genevish DOT org
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status:
Offline
|
|
what does osascript -l AppleScript -e 'whatever the script is' do?
Just wondering if it's because it can't execute an already written script or because osascript can't function....
|
Just who are Britain? What do they? Who is them? And why?
Formerly Black Book
|
|
|
|
|
|
|
|
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status:
Offline
|
|
It's a simple script that gets the current track from iTunes and saves it t a text file. PHP then parses that text file and displays the result on the page.
I found a workaround by using Recent Tunes, although I'd prefer not to have to run another application...
|
Scott Genevish
scott AT genevish DOT org
|
|
|
|
|
|
|
|
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status:
Offline
|
|
just run the headless version of Kung-Tunes and worry about other things in life.
|
"Have sharp knives. Be creative. Cook to music" ~ maxelson
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|