PHP AppleScript/Automator

Can someone please suggest where I can start researching the following solution:
I want to use PHP (on my OS X Server) to call and AppleScript or Automator Script on the OS X Server and return some information about the system.
In this case I want to use a form on a host web site (on OS X Server) to query the OS X Server (via. Automator?) about how much disc space is left on a users account.
Thank you.

Since this is the web server and since you control the application, why not go directly to a bash shell script and skip the php layer? (You could certainly wrap this in [php and system commands|http://us3.php.net/system] and embed the command within php which is itself embedded in html, but you can also use a cgi that does the .sh directly as a cgi, too.)
This bash shell script (or system call) would involve invoking the shell quota command.
Probably the most interesting issue is determining the particular user involved, since CGI is (usually) configured to operate under a CGI-specific username and not the context of the particular user.
I'd tend to expect somebody has already done this sort of thing, either via a web interface and some php or via something like Lithium and its remote monitoring capabilities. Which means poking around at topics such as [Quota Monitor Menu|http://www.afp548.com/article.php?story=20070619191504405] or such. (And I haven't looked to see if Lithium can monitor this particular data point; I don't immediately see quotas in the snmp mib, but I also don't have quotas enabled.)
There may well be a better approach.
What works best for you here depends highly on your particular requirements, of course.

Similar Messages

  • I want to create an applescript/automator tool to launch the "Add to library" command in iTunes with a specific path. Need process under the hood

    I want to create an applescript/automator tool to launch the "Add to library" command in iTunes with a specific path. I need to know what process is run under the hood to create such a script.
    To put you in context, I have an NFS mount point with all my music and with the "add to library" command, I can add more music to the folder and update iTunes without dragging the individual folders or the whole mount point and avoid having the songs show up as doubles.
    Anyone know what OS/Unix process is being called for such a command?

    I want to create an applescript/automator tool to launch the "Add to library" command in iTunes with a specific path. I need to know what process is run under the hood to create such a script.
    To put you in context, I have an NFS mount point with all my music and with the "add to library" command, I can add more music to the folder and update iTunes without dragging the individual folders or the whole mount point and avoid having the songs show up as doubles.
    Anyone know what OS/Unix process is being called for such a command?

  • Do Applescript / Automator work with Final Cut Express?

    Hey list,
    I'm a nubie in all things Applescript / Automator related. Does Final Cut Express support commands from these? For example, can I tell it to go pick up a batch of photos I created, put them in a seqeunce, and export them as an MOV? If so, it would make my life a lot easier
    -Chris
    Message was edited by: Chrisryantaz

    Hi(Bonjour)!
    If you want to drive an appication by applescript or automator, this application has to be "driveable" by script.
    If you open Applescript editor, select dictionnary and look if the application appears. If not, it cannot be driven by scripts.
    FCE is not scriptable. You can automate the lauching of the app itself (from finder scripts) but no more.
    But with select all command, you can drag all your stills (they will be inserted in the same order as they appear in column list view) in timeline.
    Also, use the "storyboard tips" by placing them in a diffrent order in icon view (in perfect row and column), select all and drag in timeline. The order will be respected from upper left-corner to lower-right.
    Michel Boissonneault
    Message was edited by: Michel Boissonneault

  • How on EARTH to parameters work in AppleScript Automator Actions for SL?

    Prior to Snow Leopard, creating a new AppleScript Automator Action would create a template something like...
    on run{input, parameters}
    but now, on Snow Leopard, I get:
    on runWithInputfromAction_error(input, anAction, errorRef)
    where to I get the 'parameters' collection from? If I just reference 'parameters', without it being declared in some way, I get errors....
    I assume there is some new mechanism in SL, what is it??
    Thanks

    Sorry, I misunderstood what you said the first time around. I thought that you wanted to use the +Run AppleScript+ action within Automator but now I see that you are trying to create a new Automator action using applescript. Now that I try it in Xcode I to get the same method/handler signature. Tried to look at the [Mac Dev Center|http://developer.apple.com/mac/library/documentation/AppleApplications/C onceptual/AutomatorTutorialAppleScript/Introduction/Introduction.html] but it hasn't been updated lately. Also tried looking at the [Automator Programming Guide|http://developer.apple.com/mac/library/DOCUMENTATION/AppleApplications/Co nceptual/AutomatorConcepts/Articles/ImplementScriptAction.html#//apple_ref/doc/u id/TP40001512] and the documentation for [AMBundleAction|http://developer.apple.com/mac/library/DOCUMENTATION/AppleAppli cations/Reference/AutomatorFramework/Classes/AMBundleAction_Class/Reference/Refe rence.html] but can't figure anything out. Sorry I don't have much experience in Xcode, so can't help you much with that.

  • Are qt-tracks switchable per Applescript/Automator?

    my idea is the following scenario:
    I do have a Quicktime.mov containing TWO video tracks.
    What I'm looking for is a 'single button'-solution, which allows to switch between both tracks.
    possible? how?
    any ready-made scripts/actions avail?
    to give additional info about my project:
    I'm recording soccer games with two (... four) cameras simultanously.
    the team's coach needs a 'dumb' solution (no word about soccer-coaches! ) , to see the action from one or the other perspective.
    it's simple to stitch the two videos into a single mov, and I do know how to 'select tracks on display' in QT7pro.
    but he doesn't.
    my idea is, to create a (local, on usb-stick) website, offering that video. (and additional info)
    or, even better, a Pages/iBooks document .......
    plus a 'switch'-button, which is a kind-of applescript/automator action/whatever, which changes 'priority'. that way both videos are always in synch.-
    anybody any idea?
    thanks in advance
    k.

    I'm recording soccer games with two (... four) cameras simultanously.
    the team's coach needs a 'dumb' solution (no word about soccer-coaches! ) , to see the action from one or the other perspective.
    it's simple to stitch the two videos into a single mov, and I do know how to 'select tracks on display' in QT7pro.
    but he doesn't.
    Hi Karsten, it's been while since I last saw a posting by you here.
    Simplest approach would be to create a file containing side-by-side or over-and-under display of two angle cameras or a combination of the two to display four simultaneous camera angles. If you combine, align, and offset the video tracks in QT 7 Pro and then compress to your target diplay file, then the sync alignment of the source tracks will be locked in the combined frames of your final output file unlike individual source tracks each of which might drop frames independently during playback in a multiple video track standalone file. This, of course, means that all viwing angles are displayed simultaneously and the viewer must switch his or her attention to the specific angle of interest but does allow you to play the file in any compatible media player, on a web site or on any compatible mobile device without having to program track switching which may or may not be compatible will all of the viewing options previously mentioned.
    A second approach would be to key your video tracks to alternative language options and have the viewing angle (track) change when the associated language is selected. Unfortunately, this only works in apps/on devices which support built-in alternate languages and/or multiple video track control. For instance, it QT X and QT 7 will switch the video track when the appropriate language is selected but VLC has separate built-n video track switching controls and iTunes doesn't recognize alternative video tracks. Unfortunately, there is a secondary problem with this approach. Playback can sometimes become jittery after switching tacks. This problem can be correctly by momentarily stopping playback and then restarting it but this can be a pain.
    A third option might be the use of sprite buttons to script switching between tracks. Unfortunately, I can't say how difficult or successful this approach may be based on any personal experience.

  • New  discussion category request -- Applescript & Automator

    Dear Administrators, Jay T. et. al,
    I think it would be a nice addition to the Aperture Discussion if you added a new sub-category for us: Applescript & Automator.
    Scripting and automation will be a big part of Aperture's future success. It will make it easier for us propeller heads to monitor developments it we have a dedicated category we can subscribe too. I won't subscribe to the entire General Usage cagegory because there would be to much daily traffic on unrelated topics.
    I don't think this will prevent the general audience from seeing interesting posts on these topics.

    It would be nice to have a good location for more technical posts along those lines. Don't let the lack of one stop you though!

  • AppleScript/Automator training

    Anyone here know of anyone in the Ohio area that offers Applescript/Automator training?

    Anyone here know of anyone in the Ohio area that offers Applescript/Automator training?

  • Calendar triggered sending of emails via AppleScript / AutoMator

    Let us say that I have groups defined in my Contacts app.
    I want an AppleScript / Automator workflow that will send a predefined text (with placeholders for first name) a predefined number of hours (say 12 hours) before a calendar event / date (say Thanksgiving) one by one to each person in a specified group.
    I guess I could spend a few hours building this, but it sounds like something someone must have done before.
    Any pointers?
    Thanks.

    Sorted it. I need to change addRecipient to setRecipient.

  • Applescript & Automator- display dialog title

    I'm trying to make an Automator service. For one of the steps I would like to use an Applescript that looks something like the one below.
    set dpaste to "Enter a title, press tab, add some text, and click Continue when you're done."
    set dialog_title to "Post To Blog"
    set dpastedialog to display dialog dpaste with title dialog_title with icon 1 buttons {"Cancel", "Continue"} default button 2
    if button returned of dpastedialog is "Continue" then
    tell application "System Events"
    activate
    keystroke "v" using command down
    end tell
    end if
    However, the line "set dpastedialog to display dialog dpaste with title dialog_title" seems to be giving Automator some trouble. Whenever I try to compile/run the script, I get the following error message from Automator: "Expected end of line, etc. but found identifier" with the variable "dialog_title" selected.
    When I run this script from Applescript Editor I get no trouble.
    Thanks!

    Test the script in the AppleScript Editor until you resolve the issue. Alternatively, post to the AppleScript forum under OS X Technologies.

  • Applescript/Automator to import Photoshop Elements Albums?

    My husband finally converted to a Mac in January (yay!!!), and all in all everything works beautifully for him, because all of the programs he was using on his Windows PC are on his Mac.  Our biggest issue though is that Photoshop Elements will not sync through iTunes on his Mac.  While you might think it would be easier for him to just convert his albums to iPhoto or Aperture, we will not discuss the reasons why this is not going to happen :-)
    However, I'm trying to see if there isn't a way for me to create some kind of "background" automation that could copy his albums into iPhoto or Aperture.  I use Aperture myself, so in using "referenced" files he would only end up with copies of the albums themselves, and not actually duplicate the photo files.  I haven't used iPhoto enough to know if this is possible.
    Can anyone think of a seemless way I could set this up for him?  It wouldn't need to be TOTALLY automatic.  I mean I could give him an icon to click occasionally.  I just don't see anything in Automator for Elements, so I would have to do an Applescript if even possible, and I while I can take an existing applescript sometimes and modify it to my needs, I'm DEFINITELY not very good at Applescript.
    Or should I really just make him move away from Photoshop Elements?
    Thanks!
    Danita

    Danitaz,
    Did you ever figure out the problem with your mail that was going out from the wrong server (2 yrs. ago)?  I have the same problem from my MacBook Pro, using Mac Mail.  I try to send email from my work account and then find to my surprise and dismay that I get an autoreply in my personal gmail account from the person I wrote to.  I look in the Sent mail for my work account and it looks like the message went from there but I can see in the reply that it instead went from my gmail account!  I tried checking the box in my work account that says "send only from this SMTP server" but that didn't fix the problem.  The only way seems to be turning off the gmail in order to send with certainty from my work account.  If you have any suggestions I would love to try them.  Thanks!
    PS Sorry to write off topic here.  I wanted to reply to the original posting but I guess since it is so old I couldn't do so.

  • Find text in webpage and email notification applescript/automator

    Hey guys, I'm trying to make (what I think is) a fairly complicated automator/applescript action.  Basically, I'm trying to buy a certain product and it is only available on the webpage at certain times. So I want to create a function that will constantly run in the background on my computer. I want this function to reload a safari page every 10-15 minutes (the one with the store's product page), search for text (the name of the product) and either stop there if the text isn't found or if the text is found, open mail and send myself an email notification so that I'll get it on my phone if the product becomes available. Is this possible at all?

    this might do what you're looking for:
    on idle
              set pagURL to "http://page.url.com?whatever"
              if application "Safari" is not running then
                        quit
                        return
              end if
              tell application "Safari"
                        set URL of document 1 of window 1 to "http://your.web.address/"
                        delay 5
      -- delay to let page load. 
      -- there are more elegant ways of doing this using do javascript, but this will suffice.
                        if source of document 1 of window 1 contains "search text" then
                                  my sendAMail()
                        end if
                        return 900 --fifteen minutes
              end tell
    end idle
    on sendAMail()
              tell application "Mail"
                        set theMess to make new outgoing message at end with properties {sender:"your name", subject:"some subject line", content:"The message you want to send to yourself", visible:true}
                        tell theMess
                                   make new to recipient at end of to recipients with properties {address:"[email protected]"}
                        end tell
      -- send theMess
              end tell
    end sendAMail
    copy it into the applescript editor, edit in all the correct information about the web page, your email address, etc., then save it as a stay open application.  when run, it will periodically reload and check the page - adjust the number after the return statement to set it to different time periods.
    test it first, then when you're ready to use it set visible:false in the line where you make the message, and uncomment the send theMess line.  this will get mail to make and send the message invisibly.

  • Applescript, automator, and iCal

    Hi - I'm having a lot of trouble finding the right documentation to do a little applescript in an automator workflow.
    Our exchange server, for reasons we don't really know in spite of playing with the settings, sends all calendar events to me with calendar "badcal" and with an alarm set 15 minutes before the event (we've tried turning the alarms off in various settings to no avail). So, now, I open each of these up and manually change the calendar to "goodcal" and set the alarm to "None."
    I'd like to create a simple automator service so that I can either click on an event and run the workflow or -- even better - just go through all of the entries in "badcal" changing the calendar and alarm setting.
    Can someone help me or point me in the right direction?
    Thanks,
    Gerry

    Hi - I'm having a lot of trouble finding the right documentation to do a little applescript in an automator workflow.
    Our exchange server, for reasons we don't really know in spite of playing with the settings, sends all calendar events to me with calendar "badcal" and with an alarm set 15 minutes before the event (we've tried turning the alarms off in various settings to no avail). So, now, I open each of these up and manually change the calendar to "goodcal" and set the alarm to "None."
    I'd like to create a simple automator service so that I can either click on an event and run the workflow or -- even better - just go through all of the entries in "badcal" changing the calendar and alarm setting.
    Can someone help me or point me in the right direction?
    Thanks,
    Gerry

  • Applescript/Automator and iWork

    Is there any way to script the iWork programs...? I have a basic workflow in which I export a Numbers sheet to CSV, then take one of those files and run a droplet on it to convert it to tab-delimited (an AppleScript droplet I wrote, adapting from code I found).
    I tried using Automator's Record function in Leopard, but that doesn't seem to work predictably in this instance since it involves menus and such.
    Thanks,
    Dov

    For these items, you must use the Automator's feature allowing you to record a set of actions then replay them later.
    It's really boring but there is no provision to drive text blocks by AppleScript in Numbers.
    At this time, I leave the Fonts dialog (cmd + T) and the Colors inspector open so I may apply what you required easily.
    select a chunk of text and apply the wanted text color or the wanted striketrough mode.
    Highlighting is not so easy because it apply on a full line of text.
    Yvan KOENIG (VALLAURIS, France) mardi 17 novembre 2009 19:30:20

  • QUESTION FOR Applescript / Automator killers

    Hi guys,
    Can someone tell me a way to select folder(s) by the type of files of their content ?
    and then pass them as variable to proceed a search only in those folders ?
    For example :  get every folders containing .wav files ---> = Variable
    Search files named "xxx.app" in all the folders of Variable...
    Automator or applescript are welcome .
    Thanx in advance.
    Best from paris (sorry for my english)
    Nico

    okay this is how i want it to work but it didn't ...
    Where am i wrong ??
    i feel im getting closer thanx to you
    on run {input, parameters}
              set filesFound to do shell script "
    OLDIFS=$IFS
    IFS=$'\\n'
    a=($(find ~/Documents -iname '*.wav' -execdir pwd \\; | sort -u))
    for i in \"${a[@]}\"
    do
              find \"$i\" -iname '*.app'
    done
    IFS=$OLDIFS
              set theResult to quoted form of filesFound
              repeat with i from 1 to the count of theResult
                        set this_file to (item i of theResult)
                        tell application "Finder" to open this_file
                        tell application "System Events"
                                  if exists (process "my process") then
                                            repeat until not (exists (process "my process"))
                                                      delay 1
                                            end repeat
                                  end if
                        end tell
              end repeat
    end run
    Message was edited by: Nico44044

  • Editing Mavericks Tags Through AppleScript/Automator

    Hi,
    I am trying to edit the tags of a folder on my computer though a folder action so that I do not have to manually edit tags I use frequently. Is there any way to set up Automator or AppleScript to edit them for me?

    The old Finder labels and the new tags overlap a little bit; the new tags can be set by using the xattr utility.  A decent description is in this Ask Different topic.
    You don't necessarily need Cocoa-AppleScript to manipulate Spotlight tags and extended attributes, but ff you are just wanting a starting spot for Cocoa-AppleScript in general, you might take a look at Mac OS X Automation - they have several tutorials and sample projects there.

Maybe you are looking for