Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

Article:
  AppleScript Primer for Mac OS X
Subject:   PHP and applescript
Date:   2002-02-05 07:35:56
From:   DH_Ivory
I'd really like to know if there was a way for a PHP script to activate an Applescript.


This would be cool. FOr instance you could upload an image and then get an Applescript to activate Photoshop to process it, resize, sepia, mask, etc... then copy it to the Library/WebServer/Documents/ directory where it could be dynamically included into a webpage - using PHP & mysql.


I do something similar using imagemagick now - but being able to use all the scriptable applications on a Mac would be awesome!!!


Are their any hooks possible - is this cover in "In a nutshell"?

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • PHP and applescript
    2004-02-16 08:59:23  jaharmi [View]

    You can call a script from the command line with the osascript command. Check out its man page. You can either call a fairly uncomplicated line of AppleScript with its -e flag or you can call a full external script file (similar, in my mind, to what I've done with the little bit of awk I know).

    In Panther, you can also do some image transformations at the command line or via AppleScript. Check out the sips utility (no man page, alas, do sips -h to get help) and the Image Events scriptable background application. They can't do everything ImageMagick or the like can do, but for some basic stuff (thumbnailing and so on), they may suit your needs (because they are accelerated for the G4/G5/GPU in Panther) or be part of a larger workflow (they can attach ICC color profiles).