Apple Script won't create new folder

Hi all,
First of all, let me explain that in no particular way I am any good with applescript. I find it confusing at the best of times. I've got a bit of code that will check to see if a new folder is created in a specific location. If a new folder is created, then it will copy the name of the folder and create a new folder with the same name in a different place. The reason for this is that I separate my file types (I'm a photographer) and I keep my RAW files in one folder, my PSD files in another, my JPEGs in another and so on. The current code I have worked up until I installed Yosemite as well as Server on my mac mini. Here's the code:
on adding folder items to this_folder after receiving added_items
     set p to POSIX file "/Volumes/Projects/1. Raw"
     try
          tell application "Finder"
               repeat with item_ in added_items
                    if kind of item_ is "Folder" then --if its a folder then make another in Ra
                         make new folder at p with properties {name:item_}
                    end if
               end repeat
          end tell
     on error
          display dialog "Error occurred"
          return
     end try
end adding folder items to
The action is set to the JPEG folder, where an application automatically adds a folder (for this example, I'll use "z. test").
z. Test is detected in the JPEG folder, and then the folder is replicated across to the other separating folders ready for when any new files are added. Trouble is, the error occurred dialog box shows up. I have the appropriate permissions for the hard drives that the folders reside on, and are replicated to the subfolders too.
Is there anyway of finding out what the error is that's occurring? Or am I missing something since upgrading to Yosemite/Server? Any help would be most appreciated!
Ian
Th

Hi,
You can't rename an item with an object (the item_  is an object of type alias), use the name of item_
To know the error, use the parameter in on error block.
Try this :
on adding folder items to this_folder after receiving added_items
    try
        set p to "/Volumes/Projects/1. Raw" as POSIX file as alias
        tell application "Finder"
            repeat with item_ in added_items
                if kind of item_ is "Folder" then --if its a folder then make another in Ra
                    set tName to name of item_
                    make new folder at p with properties {name:tName}
                end if
            end repeat
        end tell
    on error err
        activate
        display dialog "Error occurred : " & err
    end try
end adding folder items to

Similar Messages

  • My computer won't create new folders-only new briefcases

    HP heard-1360t desk top running Win 7 64 bit
    My computer won't create new folders. It creates new briefcases instead.  It does not matter whether I use the New Folder link at the top or Right Click --> New-->New Briefcase .  The New Folder option is not there.
    Does anyone know how to get it back?

    Hi,
    You've posted few times in this forum already. Please check the following link:
       http://h30434.www3.hp.com/t5/Desktop-Operating-Systems-e-g-Windows-8-Software-Recovery/Windows-7-64-...
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Can't create new folder in home folder when saving files

    In gnome, when I want to save any file in my home folder, and I want to create a new folder in my own home. The new folder appeares for several minutes and then disappears.
    If I create new folder in other directory. There is no such problem.
    Also I can create new folder in my own home directory in nautilus or by mkdir.
    any one can help me.....
    Thanks very much....

    I think either way should work OK - it's less of a security risk to use a standard account for "everything", including web browsing, but I confess I don't myself do this. You would again have to authenticate with an admin username/password if you do download and install from the standard account.
    Whichever way you do it, this article may be relevant:
    *About file quarantine in Mac OS X v10.5 and v10.6*
    http://support.apple.com/kb/HT3662
    It includes the following:
    If you have multiple user accounts on your Mac, the user account that downloaded the file is the only user account that can remove the quarantine attribute to the file. All other user accounts can open the quarantine file, but they will be presented with the quarantine dialog box asking "Are you sure you want to open it?" every time they open the file.
    --------------------

  • Can't create new folder to Applications in standard account

    Hi.
    As I have two accounts one admin account and other standard account and last time it didn’t work in both.
    So I just restored factory settings like described here: http://support.apple.com/kb/ht3910
    This fixed the problem.
    Now again I can't create new folder to applications but this time it doesn’t work only in my standard account but it does work in admin account.
    Previously I downloaded this program to open pdb files :http://www.loghound.com/pordible/
    But it didn't work for me so I removed it to Trash. That's when I noticed that the new folder icon in applications isn't active but I can't be sure that this caused it.
    I used Disc Utility to repair my macbook pro hard disk using Mac OS X Install DVD but it didn't fix the problem.
    Is there any way to fix this problem without restoring factory settings again?

    I think either way should work OK - it's less of a security risk to use a standard account for "everything", including web browsing, but I confess I don't myself do this. You would again have to authenticate with an admin username/password if you do download and install from the standard account.
    Whichever way you do it, this article may be relevant:
    *About file quarantine in Mac OS X v10.5 and v10.6*
    http://support.apple.com/kb/HT3662
    It includes the following:
    If you have multiple user accounts on your Mac, the user account that downloaded the file is the only user account that can remove the quarantine attribute to the file. All other user accounts can open the quarantine file, but they will be presented with the quarantine dialog box asking "Are you sure you want to open it?" every time they open the file.
    --------------------

  • HT1449 new folder greyed out, unable to create new folder, anybody know why

    trying to transfer Itunes to a new External drive, unable to create new folder on new drive as detailed in Apple instructions, anybody know why.

    Unless you have a utility that will let you R/W NTFS they as noted - reformat to a +HFS file system - aka -
    Mac OS Extended (Journaled) - using Disk Utility.
    The Mac OS can read/write +HFS and FAT 32 but can only read NTFS.
    MJ

  • When I attempt to send a text from the new iPad, a dialog box appears with the option to either sign in with Apple ID Password or Create New Account. I try signing in using my Apple ID password but IMessage informs me that email address cannot be verified

    When I attempt to send a text from the new iPad, a dialog box appears with the option to either sign in with Apple ID Password or Create New Account. I try signing in using my Apple ID password but IMessage informs me that email address cannot be verified because it is already in use ??? What am I doing wrong?

    settings -> iTunes & App Store
    click on apple ID listed there
    select Sign Out
    sign in with the proper account
    from then on, when the store ask for your password it should be with the correct ID

  • When I want to organise my bookmarks most of the options are greyed out and cannot be used including create new folder! Help

    '''''''''bold text'''''''''
    When i want to organise my bookmarks most of the options on the organise bookmarks menu are greyed out and cannot be used - including create new folder etc. Help please.

    Make sure you are not in the Private Browsing Mode:
    File > Private Browsing is UNCHECKED.

  • Not able to create new folder in list/library sharepoint 2013 foundation

    I am not able to create new folder in library and also not able to edit existing list item
    Below is the error:
    Getting Error Message for Exception 
              System.Web.HttpUnhandledException (0x80004005): Exception of type 
              'System.Web.HttpUnhandledException' was thrown. ---> 
              System.NullReferenceException: Object reference not set to an 
              instance of an object.     at 
              Microsoft.SharePoint.WebPartPages.ListFormWebPart.EnsureList()     
              at Microsoft.SharePoint.WebPartPages.ListFormWebPart.EnsureListAndFor
              m()     at 
              Microsoft.SharePoint.WebPartPages.ListFormWebPart.UseLegacyForm()    
               at Microsoft.SharePoint.WebPartPages.ListFormWebPart.CreateChildCont
              rols()     at System.Web.UI.Control.EnsureChildControls()     at 
              Microsoft.SharePoint.WebPartPages.WebPart.get_WebPartMenu()     at Mi
              crosoft.SharePoint.WebPartPages.ListFormWebPart.CreateWebPartMenu()  
                 at Microsoft.SharePoint.WebPartPages.ListFormWebPart.OnLoad(Ev...
    Please help.It happens only on few sub sites

    Hi V_K04,
    You said that it happened only on few sub sites, whether this issue occurred on some subsites, and some subsite worked well.
    Please check whether there are some differences between the subsites that worked well and the problematic subsites. 
    Whether this issue occurred on all libraries and lists on problematic subsites.
    Whether there are some customizations in these problematic libraries and lists.
    Please create a new library and a new list, test again, compare the result.
    BestRegards,
    Wendy
    Wendy Li
    TechNet Community Support

  • Can't create new folder on an external hard drive, and how to transfer files?

    Hello everyone,
    the non-English speaking videographer I translate for is having problems operating his Premiere CS5 for Mac from an external hard drive. He cannot create new folder on the external hard drive (the "New Folder" button is grayed-out when tries to export media onto the external hard drive) and when he simply tries to create new folder, the "new folder" option isn't available.
    He suspects it's because the hard drive was formatted for PC.
    Questions:
    - should PC-formatting cause that problem?
    - what's the proper way to transfer media files from PC-formatted external hard drive to the internal hard drive on Mac?
    Would appreciate your advice.
    Dimitri Vorontzov

    He is right on the money
    Now, for the sad or FAT part. You need to format the drive as FAT32 to make it work both on PC and MAC but, and that is a big BUT, the max file size of any given file will be 4GB. I haven't treid other formats yet, like the journaled MAC OS extended, but I don't think that would work. We transfer our files through or own gigabit network so I never had to try it, other than FAT32 formatted SDHC cards.

  • Create new folder with selected items

    I have a bunch of movies that I would like to place into individual folders of the same name (Without the extension name). I wanted to try and create a keyboard command to do this with the selected files, but can't manage to figure out how!
    What I did was try to create a new service command in automator, then went to keyboard shortcuts in system preferences to assign a keyboard command to it.
    I want to make something that works like control-command-n (to create new folder from selected items), only I want the items to be in individual folders of the same name.
    eg.
    Files selected such as:
    The incredibles.avi
    Cinderella.mkv
    Dogma.mp4
    each moved into individual folders labeled as:
    The Incredibles
    Cinderella
    Dogma
    Also, is there a way to change the control-command-n shortcut so it can create a new folder from a single item? It only works when there is more than one file selected.
    Thanks so much for any help!

    I am going to guess that you start off with a single file - what are you doing to generate these files? My *Get Names of Finder Items* action can get a name to use in the *New Folder* action - items passed to the New Folder action will get copied to it, so a little more detail may help in creating the workflow.
    The *Dispense Items Incrementally* action can also be used to dole out the items one at a time - knowing what the workflow is doing would help with the use of this action as well.

  • Create new Folder

    How to create new folder in actionscript?

    Wrong forum.
    This has no connection to InDesign.
    You need to use the AIR File class...
    Harbs

  • How Create New Folder in KM with Name having Special Character

    Hi,
    How to create new Folder in KM with name having special character in it.
    Right now its not allowing me to create folder when i have Colon( as one of the character in name of the folder.
    Is there a way to change this validate?
    Any help is appriciated.
    Thanks

    Hi DK,
    I'm not sure about special chars such as ":" but ifyou need to have your folders displaying special language chars (like german chars), have a look into the below link.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30deb229-d570-2910-4aaf-8858e0660f05
    Hope that helps.
    Ray

  • Cannot create new folder?

    I have just moved to a new hosting and have connected to it
    and I can edit files. When I try to add a folder to the remove I'll
    get
    "An FTP error occured - cannot create new folder .
    Access denied. The file may not exist or there could be a
    permission problem".
    Any idea?

    Hi,
    Did you make any changes before the issue appears?
    Before going further, you may try the
    system restore to go back to a previous status and check the result.
    Tracy Cai
    TechNet Community Support

  • Access Denied when Exporting, Creating new folder.

    My normal workflow on some occasions is that I work on images then making a selection, I will export then to a folder on my desktop.  I normally hit the Export and on the pop up I click on create new folder and export the images to the folder.
    Since the new update, when I try to create a folder it gives me Access Denied.  If I create the folder first, there is no problem.

    Hi,
    I would like to suggest you run the following commands with elevated privilege.
    takeown /f {Folder Path}
    cacls { Folder Path} /G administrators:F
    Note: please replace {Folder Path} with the real folder path.
    After that, please try to delete the folder again.
    Does it work?
    Regards,
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Access Denied for creating new folder

    Hi friends,
    When i tried to create a new folder under shared folders in catalog as a weblogic user, i couldnt get a option for creating new folder. But i have that option enabled in the My folders area.
    Im not sure why the create folder option is not enabled for the weblogic user in the shared folders.
    Im on OBIEE 11.1.1.7 and for a workaround i referred the below link
    https://forums.oracle.com/thread/2520389
    But i followed the steps mentioned in the above link, but not succeeded still facing the same create folder privilege issue under the shared folders for the weblogic user.
    Kindly suggest me your approach for solving this issue.
    Thanks
    Regards,
    Saro

    Hari,
    Restart the services (weblogic and BI) you should see it I have observed same kind of behavior in 11.1.1.7.0 (Admin tab missing and No Permissions icon for weblogic user) dont know exact reason
    Restart is not a solution but will see if you are able to see or not
    Thanks,
    Saichand

Maybe you are looking for