Get filename and write... with Apple Script

Discussion in 'Mac Programming' started by vloryan, May 28, 2015.

  1. vloryan, May 28, 2015
    Last edited: May 28, 2015

    vloryan macrumors member

    Joined:
    Jan 11, 2014
    #1
    hi guys, i hope you can help me with this:

    whenever a zip file named "whatever.zip" is placed in a folder , i want applescript to get that filename (without the extension: "whatever") and create a new and empty textfile ("whatever.txt")with that name in that same folder.

    any idea? thanks for your help!
     
  2. subsonix macrumors 68040

    Joined:
    Feb 2, 2008
    #2
    You can do this with a folder action in Automator. But are you sure you want a unique empty text file for each file and folder that gets dropped in your folder? You can also add them as entries in a text file, or to the system log with an added tag that you later can filter on in Console.app.
     

Share This Page