Applescript copy Files-Folders help.

Hello everybody,
I need your help on a copy files – folders script issue. I have two folders A and B, I need a script that every time I drop a file or folder on A to copy the files or folders on B.
I am new on this Mac amazing world, so, I really need your help.
Thanks,
Andy
p.s. Sorry for my English, is not my native language..

Hi Andy
Try the below folder action script, as the code stands it will not replace any folders/files in "B" if they are the same uncomment the "with replacing" to replace folders, files that are the same in "B".
Also as the code stands it will leave the origional copy in folder "A"
You will need to save the code to:
Macintosh HD:Library:Scripts:Folder Action Scripts:
and attach it to folder "A" , making sure to enable folder action scripts.
on adding folder items to thefolder after receiving theseItems
tell application "Finder"
duplicate theseItems to folder "Macintosh HD:Users:Andy:Desktop:B:"--with replacing
end tell
end adding folder items to
----------

Similar Messages

  • Not able to copying files/folders from one Document Library to another Document Library using Open with Browser functionality

    Hi All, 
    We have SharePoint Production server 2013 where users are complaining that they are not able to copy or move files from one document library to another document library using “Open with Explorer” functionality.
    We tried to activate publishing features on production server but it did not work. We users reported following errors:  
    Copying files from one document library to another document library:
    Tried to map the document libraries and still not get the error to copy files: 
    In our UAT environment we are able to copy and move folders from using “Open with Explorer” though.
    We have tried to simulate in the UAT environment but could not reproduce the production environment.  
    Any pointers about this issue would be highly appertained.
    Thanks in advance
    Regards,
    Aroh  
    Aroh Shukla

    Hi John and all,
    One the newly created web applications that we created few days back and navigated to document library, clicked on “Open with Explorer”, we get this error.
    We're having a problem opening this location in file explorer. Add this website to your trusted and try again.
    We added to the trusted site in Internet Explorer for this web application, cleared the cache and open the site with same document library but still get the same above error.
    However, another existing web application (In same the Farm) that we are troubleshooting at the moment, we are able click on “Open with Explorer”,  login in credentials opens and we entered the details we are able to open the document
    library and tried to follow these steps:
    From Windows Explorer (using with Open with Explorer), tried to copy or move a files to
    source document library.
    From Windows Explorer moved this file to another destination document library and we got this error.
    What we have to achieve is users should be able to copy files and folders using
    Open with Explorer functionality. We don’t know why Open with Explorer
    functionality not work working for our environment.  
    Are we doing something wrong? 
    We have referred to following websites.
    we hope concepts of copying / Moving files are similar as SharePoint 2010. Our production environment is SharePoint 2013.   
    http://www.mcstech.net/blog/index.cfm/2012/1/4/SharePoint-2010-Moving-Documents-Between-Libraries https://andreakalli.wordpress.com/2014/01/28/moving-or-copying-files-and-folders-in-sharepoint/
    Please advise us. Thank you.
    Regards,
    Aroh
    Aroh Shukla

  • Copying files folders display different sizes

    I'm pretty sure I'm not crazy, but isn't it true that when you copy files from one drive to another, the sizes as reported in the Finder may not always be equal even though the actual files may be exactly the same. Nothing fancy here, just a manual drag and drop of about 20 folders with many files in each. In all cases, one drive is displaying consistently smaller folder sizes than the other by <1% and as much as 30%. Should I worry or is this just one of those oddities of sectors and formatting and so on?

    It can vary due to File Allocation Block sizes, but 30 % would either mean a really small file... 1,025 bytes requiring 2 1,024 size block & may report 2048 on one, or one drive is not HFS+, like perhaps FAT32, in which case whole Forks can get lost.
    Or are you talking about the Get info Window that reports in Bytes for size?

  • How can I copy file/folders from and to hard drives? How can I have two or more windows of explorer so that I can drag and drop from one hard drive to another?

    Hi,
    I am a new customer (purchased last week) of MacBookPro (latest) and its my first ever Apple laptop.
    I am almost lost to find the operating tools.
    1. How can I copy files from hard drive to computer and vis-a-versa?
    2. Only can browse one but how can I have two or more browses at the same time like in MS windows?
    3. No right click works on track pad?
    4. Is there application/ program compatible to MS office? If so how much and how can I purchase?
    5. Is there AutoCAD program that is compatible to MS Window AutoCAD? and if yes how much and how can I purchase?
    I will very much appreciate if you could email me the with the solution/answers please.
    Regards,
    Khagendra Limbu

    1) For some reason this happens once in a while with FAT32 enabled external harddrives. I have no idea why this happens but it most easily solved by reformatting the drive. First make sure you've copied everything from the external drive to your internal harddrive. You've done this earlier so I assume you know how to do this.
    Now the reformatting part. Open Finder and go to Applications. Look for the folder called "Utilities". Click on it. In it you find a program called "Disk Utility". Click on it. Now look for the external drive. You probably see two entries for the disk. Click on the one that contains the name of the drive NOT the one that describes the disk (Like for example 320.07 GB Samsung S2 Portable Media).
    Now you see four tabs in the righthand part of the window. They're called "First Aid", "Erase", "RAID" and "Restore". Click on "Erase". This opens the tab with (amongst others) a dropdownbox (Format) and a textbox (Name) . In the dropdownbox select "Mac OS Extended (Journaled). Take note! This selection disables usage of the drive with Windows PC's. If your goal is to share the drive with Windows PC's select the MS-DOS FAT option.
    Enter a label for the drive in the textbox Name. Now click on the button "Erase". This will format the drive.
    Now when it's done you can copy back all the items you've copied to your internal harddrive earlier.
    2) Opening two windows like Explorer on Windows is opening two Finder windows on the Mac. Simply click on the background. In the menubar you items like 'Finder", "File", "Edit", "View", et cetera. Click on "File" and "New Finder Window". Do this two times. Alternatively you can click on the background and press CMD-N two times.
    3) You can right click on the trackpad. This however depends on if you've enabled the feature in System Preferences. In the topmenubar click on the Apple icon and select "System Preferences". Now look for Trackpad in Hardware. Click on it. You see three tabs with the names "Point & Click", "Scroll & Zoom" and "More Gestures". Select "Point & Click" and look for "Secondary Click'. Make sure it is checked and make sure it has written "Click or tap with two fingers" written beneath "Secondary Click". When you're done exit System Preferences. Now select the background and tap with two fingers on the trackpad. This should open the contextuel menu with options like "New Folder", "Get Info" et cetera.

  • Applescript: Copy File Names into an Email

    *I've been slowly teaching myself Applescript, and can't seem to find a way to do a few things. Basically what I'm trying to do is set up a script that will run when items are dropped into a folder on my FTP. I want the script to have a pop-up dialogue, and generate an email to certain users announcing new files are on the FTP. I have these 2 parts down, but I would also like the body of the email to include a list of the filenames. This part I can't figure out.*
    *I just need to find a function that will copy the filenames of new items, and paste them into the body of the email already being generated. My current code is below. Anyone have any ideas to help me expand?*
    property dialog_timeout : 15 -- set the amount of time before dialogs auto-answer.
    on adding folder items to this_folder after receiving added_items
    try
    tell application "Mail"
    set theMessage to make new outgoing message with properties {visible:true, subject:"New Files on FTP", content:"New files have been posted to incoming folder of the FTP."}
    tell theMessage
    make new to recipient at end of to recipients with properties {name:"Jane Doe", address:"[email protected]"}
    make new to recipient at end of to recipients with properties {name:"John Smith", address:"[email protected]"}
    end tell
    send theMessage
    end tell
    tell application "Finder"
    --get the name of the folder
    set the folder_name to the name of this_folder
    end tell
    -- find out how many new items have been placed in the folder
    set the item_count to the number of items in the added_items
    --create the alert string
    set alert_message to ("Folder Actions Alert:" & return & return) as Unicode text
    if the item_count is greater than 1 then
    set alert_message to alert_message & (the item_count as text) & " new items have "
    else
    set alert_message to alert_message & "One new item has "
    end if
    set alert_message to alert_message & "been placed in folder " & «data utxt201C» & the folder_name & «data utxt201D» & "."
    set the alert_message to (the alert_message & return & return & "Would you like to view the added items?")
    display dialog the alert_message buttons {"Yes", "No"} default button 2 with icon 1 giving up after dialog_timeout
    set the user_choice to the button returned of the result
    if user_choice is "Yes" then
    tell application "Finder"
    --go to the desktop
    activate
    --open the folder
    open this_folder
    --select the items
    reveal the added_items
    end tell
    end if
    end try
    end adding folder items to
    Message was edited by: markeze

    AppleScript forum under OS X Technologies.

  • Moving vs. copying (files/folders)

    I have a single hard drive, two Users. I am launched into my main/Admin user. When a move some folders to the desktop they copy... others just move. How can that be? (Snow Leopard).

    Either they're on a different partition than the desktop, or you don't have write access to the folder containing those that copy. Press the Command key when dragging them.
    (85340)

  • Deleteing files/folders from network drive

    I have a USB drive connected in to my Airport Extreme and I have conifgured user level access accounts for this. The four the iMac G4, iMac G5, iBook and Powerbook are all able to copy and delete files/folders with no problems. My Windows Vista machine is able to copy files/folders but I am only able to delete folders when they contain no files or sub-folders - sadly I do not have access to the full message but it is related to not having the correct permissions.
    The USB drive is Mac OS X Extended format as a Fat 32 format drive did not appear on the network (this was before the recent Airport update though).
    Has anyone else encountered this problem and if so - do you know of a way around it?

    Guess it's just me
    Any ideas?

  • Copying files from Windows rips out group permissions

    Hi there all,
    Having some problems with group permissions being removed from files when data is copied from a Windows OS.
    We currently have a network of Macs that are tied to a AD/OD structure.
    We have also set a custom umask for each mac defining 002 as the permissions to be written to files.
    However, when we connect to a Windows file share using the smb:// protocol and copy files/folders across to the Mac environment the umask permissions are not written correctly.
    The User is given full control and the Everyone group is denied access. However, no group permissions are written at all.
    We have tried altering the smb.conf file to no effect.
    Could anybody shed some light on this annoying problem?
    Many thanks

    You have to install this version of samba as Apple have made a complete hash of implementing their own... Another massive fail from the worlds favourite consumer electrics company... Listen to the pro users leaving in droves...
    http://eduo.info/apps/smbup

  • Itunes allows library to point to other folders and not copy files - WHY DOESN'T iPHOTO?

    Hopefully Terence Devlin and other experts will see this. I really am intrigued as to iphoto behaviour and seek some clarification.
    I just waded through 13 pages of an old thread that was locked where Terence kept saying iphoto was all one needed to work with one's photos and kept getting called on the fact he would not answer the question "where are my photos" (photos = files) because it was so darn dangerous for anyone to touch the actual files in the iphoto library.
    I have a use case I need help on and an example of Apple's utter inconsistency here.
    Inconsistency: iTunes lets me create a library all the while pointing to the original files that *I* have imported and structured in a given directory/folder stucture.  Yes it means I manually manage what is in itunes etc, but that's how I like it. The key thing is that itunes allows the choice to import (copy) files (which makes duplicate and doubles hard disk usage) or not.
    iphoto does not allow that option.
    I just converted to Mac from a PC and copied in over 100gb of photo files - some 16,000 photos. I import new pics to the Mac using Canon native software and store them accoring to a structure/taxonomy that *I* determine and want to control - not some software's predetermined idea of events or locations or whatever.  In itunes I can make 'music' an 'audiobook' or I can make a podcast 'music', I can edit the metadata to order things in the 'library' as *I* choose and the itunes library is coole with this without havign ANY of the soruce files in its library. Naively, I thought iphoto would follow a similar philosophy.
    Use case: I discovered that iphoto has some very effective functionality for management of my uploads and sets etc in Flickr, but to do so I have to import my pics, obviously. So I did import the whole 'Pictures' folder - not for a moment considering that Apple would be dumb enough to copy every pic and make a duplicate, or that I might not get the chance to say yes or no to this in the settings, as per itunes.  Having looed for that optin and failed to find it I imported anyway to see what happened. After I realised that the Mac was heating up and files were being copied and I was going to lose another 100+gb of disk space I forced this to quit.  And thanks to others on that other thread I found the iphoto library and deleted the whole thing, getting back 100bg of drive space. All I want to do is use iphoto for the Flickr sharing/management functionality - I have no use for it otherwise. 
    Why would Apple think that not having to duplicate files is ok for itunes but not a viable option for iphoto? Why would I want to double the disk space used for every photo I store? At the very least iphoto needs to come with a health warning that it should only be used to import from external devices and be the sole manager of photos, unless one wants to use double the disk space.
    So if I want to use the sharing (i.e. Flickr uploading and management of sets etc) capabilities, should I import all or some of my folders, do my work and then delete the library each time to reclaim the disk space?

    If I import photos to iPhoto, the originals are deleted? So if I import from a card I have taken from my camera or if I connect my camera directly, the act of importing into iPhoto wipes them from my card?
    Again, you need to check your facts before getting indignant. This is simply not true. It's an option you have and not one I recommend using. But it's only an option.
    Storage costs money and I do not want to have two copies of every pic on my hard disk - especially given huge filesizes of RAW files today.
    No one is suggesting that you have two copies. You have your iPhoto Library and then you back that up. Again, less indignnation, more careful study.
    I do use other photo managers (e.g. native Canon tools) quite happily and they are far less 'exclusive' - i.e. I can use different apps with the same native file structure.
    Using other photo managers makes little sense, any more than having two address books. How do you keep them in sync. Your comment about file structure is important, we'll come back to that.
    If I want to go back to a Windows PC or any other machine and want to retain the "manual" file labelling and directory structure that I have implemented and been using for years, it seems that having a reference library that *I* know the taxonomy of is actually an advantage if I want to go somewhere else.
    If you want to retain exactly the same filing structure you have now, then don't use any Photo Manager. Stick to the file manager. You'll be missing out on a lot of options, but hey ho, it's what you want.
    That said, if you want to migrate from iPhoto to a Windows Machine then that's what File -> Export is for, and you can export from iPhoto to a folder tree matching your Events.
    And this is a big one: This is true of any Photo Manger. Especially one with lossless processing - iPhoto, Aperture, Lightroom et al.
    Here's the principle: IT IS MY DATA AND I WILL DECIDE HOW IT IS LABELLED - WHAT THE FILENAMES ARE - AND HOW IT IS STRUCTURED INTO DIRECTORIES AND SUB-DIRECTORIES.  I WILL DECIDE WHICH APPLICATION I USE TO DO ANYTHING WITH THAT DATA AT ANY POINT IN TIME
    DId you stomp your foot while writing those block capitals too?
    But here's the thing: It's your data then why the heck are you dealing with Files?
    This is the key difference, and frankly, unless you can geet this you're always going to have problems with Photo Mangers.
    The illustration I use is as follows: In my iTunes Library I have a file called 'Let_it_Be_The_Beatles.mp3'. So what is that, exactly? It's not the song. The Beatles never wrote an mp3. They wrote a tune and lyrics. They recorded it and a copy of that recording is stored in the mp3 file. So the file is just a container for the recording. That container is designed in a specific way attuned to the characteristics and requirements of the data. Hence, mp3.
    Similarly, that Jpeg is not your photo, it's a container designed to hold that kind of data. iPhoto is all about the data and not about the container. So, regardless of where you choose to store the file, iPhoto will manage the photo, edit the photo, add metadata to the Photo but never touch the file. If you choose to export - unless you specifically choose to export the original - iPhoto will export the Photo into a new container - a new file containing the photo.
    See? It's about the data and the data and the file are not the same thing. Organising your photos based on the files is like organising a shoestore based on the boxes and not the shoes.
    And here's the thing: anything you want to do with your Photos can be done either with or via your Photo Manager.
    And again, I strongly stress, this is true of iPhoto, Aperture and Lightroom.
    And please note: either with or via... Want to use a 3rd party editor, that can be done easily and so on.
    Let me correct you. "If you use an APPLE Photo Manager then it's the go-to app for whatever you do with your photos.
    Doesn't matter who makes it.
    Other Photo Managers may have more flexibility and enable greater user control."
    Sure. iPhoto's a $15 app. Aperture is a $70 one. Adobe's Lightroom is about $150. Pay more get more options.
    And remember where we came in here: You said you weren't able to choose where to store your files. You're wrong. You can. All I'm saying is that there's no point and more work to it.
    For many - including me - the Apple way seems way too dictatorial -
    Whoa. Apple are dictating nothing. You don't have to use iPhoto, you don't have to use a Mac. And remember:
    ...where we came in here: You said you weren't able t choose where to store your files. You're wrong. You can. All I'm saying is that there's no point and more work to it
    Are Ford dictatorial demanding you steer the car using a wheel? Sheez.
    and yes there are certainly advantages for some types of users of trusting one piece of software to do everything, however non-transparent it may be what it is doing or why, and with the dangers of trying to do ANYTHING else at all with one's photos.
    And again, everything is quite transparent if you take a little while to understand it. You don't understand it because you're coming from a file management  and not a data management perspective. Also no one is suggesting using "one piece of software to do everything". iPhoto leverages the Finder for storage, QuickTime for display, uses and Open-Source database and so on, it protects your original file like a digital negative.
    iPhoto may well not be the app for you. That's especially true since you don't understand it and are confusing it with a file manager. That's fine. But please, stop saying things that aren't true.

  • Can't copy files to folders

    Under "Sharing" I have clicked "Enable Access Control Lists on this volume" and proceeded to add different users in the "Access" tab and I'm trying to give them Full control to be able to create new folders and copy files anywhere they want to. The only way I can get users to have these privelages is to click on each folder in the sharing tab, and under access, change the options of the owner and group to "Read & Write". I would have to do this for each folder currently in there now, and any future folder created.
    I know there is a better way of doing this, but I can't figure out how. I would very much appreciate any help. Thanks in advance.
    firewired

    Hi: You must restart the server after enabling ACLs on the volume before Users & Groups and access privileges defined in the ACL list window apply. If you don’t do this only the standard POSIX permissions work. If you decide to disable ACLs on the volume you need to restart again.

  • Can't copy files to network client's folders

    We just switched from ARD 2.0 to ARD 3.0. ARD 3.0 is a great product - if it works. I can only copy files to ARD-clients, if I copy to the local hard disk, i. e. if it is a local client or if it is a network client and I copy to the top level of the volume. But if I copy files to the network client's desktop it doesn't work. I think the reason is that the network client's desktop is located on the server and not on the local hard disk.
    The same problem occurs if I use the new feature to copy files from or to a client using drag-and-drop with the observe window. It works with the client's local hard disk, but not with folders located on the server. This time there is no error message, but the message "waiting" - and the waiting never terminates.
    Has anybody a helping idea? Thanks!
    Greetings from the country of the football (soccer!) world cup!
    Horst

    I had the same problem, but I managed to fix it.
    In WGM check that the sharepoint of your users Home Folder is set to owner root with Read and Write permissions.
    I also created an ard_admin group in WGM and enabled open directory management on the client Macs. (Page 62 of the ARD admin Guide.)

  • Can anyone help me?Time Machine couldn't complete the backup to...  An error occurred while copying files. The problem may be temporary. If the problem persists, use Disk Utility to repair your backup disk.  What is the problem?  I've made no changes.

    I recently starting receiving the error message "Time Machine couldn't complete the backup to... An erro occurred while copying files.  The problem may be temporary.  If the problem persists, use Disk Utility to repair your backup disk.  I have had no problems backing up my MacBook Pro 2011 to my Western Digital My Book Live through a Linksys EA4500 router until recently.  I've made no major changes.  I've ran a diagnosis on my back up drive with no problems.  The Time Machine back up starts, but about after about 5 to 10 minutes I get the error message.  I can see the shared drive in Finder.  The light on the drive blinks while it starts the back up.  I can see the shared folders on the networked drive.  The backup process starts but for some reason it just stops.  Can anyone help?

    You can't repair a network volume in Disk Utility.
    Backing up to a third-party NAS with Time Machine is risky, and unacceptably risky if it's your only backup. I know this isn't the answer you want, and I also know that the manufacturer says the device will work with Time Machine, and that it usually seems to work. Except when you try to restore, and find that you can't.
    If you want network backup with Time Machine, use as the destination either an Apple Time Capsule or an external hard drive connected to another Mac or to an 802.11ac AirPort base station. Only the 802.11ac base stations support Time Machine, not any older model.
    If you're determined to keep using the NAS for backup, your only recourse for any problems that result is to the manufacturer (which will blame Apple.)

  • When new CD are inserted, posible too automaticly copy files too folders??

    Hi.
    I get a lot of cds from customers.. Is it possible too get all the files/folders on a cd too copy automaticly too my desktop and then eject it???? I am soooo tired of doing this manualy:-D If it are posible too also put the files inn a folder with the name of the CD + Date it woud be too GOOD:-)
    Best regards
    Einar

    einar,
    Yes this is possible with an AppleScript or AppleScript/Automator combination.
    The challenge will be determining whether this is a new cd or not. Without knowing everytime you insert a cd it will copy the files to the desktop/folder. There are at least two ways around this:
    1) Have a database that keeps track of the CDs that have been processed;
    2) Have a dialog that comes up once the CD is recognized and lets you decide whether you want to process the cd or just mount it.
    I will see what I can come up with using the second method.

  • Using VPN to access remote servers; copying files to desktop since "upgrading" to Mavericks no longer works. Can anyone help please?

    Hi everyone,
    I work remotely using Cisco AnyConnect (company provided) to access the company servers. Until "upgrading" to Mavericks I was able to copy files directly to my desktop – from either the servers themselves, from within Bridge, and/or by using the finder - you get the idea. Now I can only copy the files by opening them while still on the server using the native app (in my case mainly InDesign/Photoshop/Illustrator files) and saving them to my desktop that way.
    I'm a designer, I use a lot of files for my specific job every day and these files are often pretty large and doing it this way is time-consuming and really frustrating seeing as I had no such issues with the previous OS. It's not a total nightmare (yet) like some of things some of you are dealing with but I've spent more time restarting, freezing and trying to fix issues than I have actually using my darned machine. I have no choice but to access my work this way; I'm part of a much larger team and we all work on these files off and on during the day so I'm constantly needing to copy files and make sure I'm working on the most current version. Working off the server isn't an option as the speed decreases considerably... making the slightest task cringingly slow. As in 25 minutes for a PDF to be created slow.
    I've been used to my system running smoothly, without issues and fast so this upgrade is turning into a bit of a nightmare. Before I throw in the towel and try and downgrade, does anyone have any ideas? My technical knowledge where these things are concerned isn't beginner but I'm no expert  and I'm stumped. I just don't know where to start and I'm afraid of screwing something else up during the process of trying to fix this (so far) one issue and creating a snowball effect.
    I'm using a 27" iMac (late model 2012 purchased in March 2013) with a second Viewsonic monitor attached. I have a Cintiq 22HD hooked up (but not on all the time) and a Wacom tablet in use. I currently use both CS5 (work hasn't upgraded to CC yet) and Adobe CC (for personal use) on my system.
    Any help/ideas would be greatly appreciated!
    Thanks!
    G.

    Hi,
    By default, the Remote Desktop (RD) Gateway component that encapsulates RDP in HTTPS packets listens on port 443 (for TCP) and port 3391 (for UDP). After you changed the ports in Transport Settings tab, please make sure that you have opened the custom ports
    you selected in Windows Firewall.
    In addition, since you have mentioned the registry key, would you please share the entire path?
    It seems that you need to manually update the gateway in the RDP file with the port. Have you created an .rdp file? You can also refer to the link below:
    Create an .rdp file
    Best regards,
    Susie

  • HT1751 Consolidating ITunes Library Failed - message received: "Copying files failed. The file name was invalid or too long" . Please help - how to i fix this issue?

    I consulted your website for details on how to back up my ITunes Library on my PC-found the article very helpful-I reached step 7 - clicked ok and the following message came up: "Copying files failed. The file name was invalid or too long."  Please can you help and advise what I should do or how to fix this issue.   My pc operating system is Windows 7 Home Basic

    You can select a group of tracks and consolidate from the right-click context menu. You coud try consolidating in batches, say all songs by artists beginning with A, then B, etc, then the other media types, until you can isolate a problem track and then try moving that by hand and fixing the broken link.
    I also have two scripts that could help you, Unconsolidated and ConsolidateByMoving. The first can make a playlist of all unconsolidated tracks, the second can consolidate a selection of tracks by moving them instead of copying.
    tt2

Maybe you are looking for