How to make a script run after taking a screenshot?

Discussion in 'Mac Programming' started by ideal.dreams, Aug 10, 2010.

  1. ideal.dreams macrumors 68020

    ideal.dreams

    Joined:
    Jul 19, 2010
    Location:
    OH
    #1
    When I used to use Ubuntu, I was able to make a script run automatically after taking screenshot. The script would connect to my server, go to the specified directory, create a random name for the image and add ".png" after it, and then place the link to it in my clipboard. When it was done, it would delete the image from my desktop.

    I know there are services like Cloud App and Tiny Grab that do this for you, but Cloud App uploads to their server, and you have to pay for Tiny Grab in order to use your own FTP information.

    Can anyone tell me how I would do this, or if it's even possible on Mac OS X?

    Thanks,
    ~ideal.dreams
     
  2. ideal.dreams thread starter macrumors 68020

    ideal.dreams

    Joined:
    Jul 19, 2010
    Location:
    OH
    #3
    So it is possible? How would I do it with AppleScript?
     
  3. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #4
    Should be doable with folder actions which lets you run an AppleScript whenever a file is added/removed from a folder:
    http://developer.apple.com/mac/libr...tlangguide/reference/ASLR_folder_actions.html

    As for connecting to your server and uploading a file, might be able to use a third-party FTP program like Transmit which is scriptable, or possibly the built-in ftp command-line tool via Terminal, or something else.
     
  4. ctyhntr macrumors 6502

    ctyhntr

    Joined:
    Jul 21, 2010
    #5
    Google is your friend. You can google applescript and screen capture, then google applescript ftp for examples.
     
  5. ideal.dreams thread starter macrumors 68020

    ideal.dreams

    Joined:
    Jul 19, 2010
    Location:
    OH
    #6
    I prefer direct answers - with google you get half of your answer, and then something completely different.
     

Share This Page