Script for copying files to drop boxes of other Macs

I don't know much about scripts as yet, but for daily backup purposes
I would like to copy all new or modified files from various folders
to the drop boxes of two other Macs (like the old DOS command XCopy)
and then reset the "modified attributes" (is there something like that at all?)
of these files.
A script could do this without the need to always find and select these files
and to always confirm the messages "You can put items into “Drop Box”,
but you won’t be able to see them. Do you want to continue?".
Thanks!

Here is a short skeleton which doesn't treat subfolders.
May you check if it do what you want ?
property sourceFolder : "/Users/home/Documents/Pages/current/"
property destFolder : "/cr1’s iMac.afpovertcp.tcp.local/cr1's%20Public%20Folder/Drop Box/backup/Documents/Pages/current/"
on run
tell application "System Events"
set dest_folder to path of folder destFolder
set listeSource to path of disk items of folder sourceFolder
repeat with sf in listeSource
if visible of disk item sf then
tell disk item sf
set sn to name
set smd to modification date
end tell
if exists disk item sn of folder destFolder then
set needCopy to modification date of disk item sn of folder destFolder is not smd
else
make new file at end of folder destFolder with properties {name:sn}
set needCopy to true
end if -- exists disk item
if needCopy then my copyFile(sf, dest_folder)
end if -- visible …
end repeat
end tell -- System Events
end run
on copyFile(sourceFile, targetFolder) (*
sourceFile is the path to the source file as text,
dest_folder is the path to the destination folder as text
newFileName is the name of the file as text
tell application "Finder"
duplicate file sourceFile to folder targetFolder with replacing
end tell
end copyFile
Yvan KOENIG (VALLAURIS, France) mercredi 16 décembre 2009 18:33:43

Similar Messages

  • Logon Scripts for copying files in Windows 7

    Issues using Logon scripts to copy files in windows 7.  Its default is to append the file rather than copy and replace, which is what XP did.  How can I achieve the same results using
    logon scripts in W7 to copy any files to specified folders and replacing old files.  The reason for this is that we use a software that performs offsite/onsite updates and the only way all the users can have the correct version/tables is to either manually
    update each user in a 90+ user environment or use a logon script to perform the coping of the updates.  Unfortunately the software support won’t create a (while logging in to software) patch for this.  So we have to force it during the user logon.

    Hi Novice,
    It should depend on your script content. it's recommended you ask in the official scripting guys forum for professional help:
    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
    Karen Hu
    TechNet Community Support

  • Script for copying or moving files from windows server to another remote windows server

    Copy below 2 line into notepad and save as movescript.vbs
    execute in command prompt
    c:\cscript movescript.vbs  (Press ENTER)
    Files will move to remote location.
    =========================================
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    objFSO.MoveFile "C:\scripts\*.txt","\\servername\c$\share"
    =========================================
    for copy files to remote location
    =========================================
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    objFSO.CopyFile "C:\scripts\*.txt","\\servername\c$\share"
    =========================================
    Lets us know if you face any error. reply back to me on [email protected]
    Thank you.....
    Regards Ravikiran MCITP

    What is your question?  Are you asking how to do this?  Can you post the errors?
    ¯\_(ツ)_/¯

  • Receiving files in Drop box

    What is a trustedmethod to have files sent to my Drop Box by another party?

    Are you referring to the paid Dropbox service? If you are, I suggest visiting their site for more information:
    https://www.dropbox.com/help/90
    If you are referring to the Drop Box in your Public folder then you will need to enable file sharing so that your system is visible on the network and listed under the 'shared' section in the finder window. Other people can then connect to your system to gain access to the Drop Box inside the Public folder so that they can deposit files in your Drop Box.

  • MAXL Script for copying outline

    Can we write any MAXL Script for copying outline from one aplication/datbase to another application/database.
    Example copying olt from app1.dbb1 to app2.dbb2

    No and yes.
    There is no MaxL statement for copying an outline from one DB to another (Unless you are converting from BSO to ASO). But you can shell system commands like xcopy within a MaxL script (of course you could just do this in your batch or shell script) . Just make sure you stop the Dbs before doing the copy

  • Need script for moving files to specific directories base on csv

    Hi,
    I have a question. I have about 2000 files (pdf), which I need move to specific directories and subdirectories, which are based on csv file.
    Csv is looking like this:
    filename;directoryname;subdirectoryname;subdirectoryname;.......etc.
    I have a script for creating directories with subdirectories from csv file, but I need this script for moving files to this directories.....
    Thanks a lot for every help.
    Best Regards
    Petr, OS X Mavericks

    private function snapshotLastFrame():void
    gotoAndStop( this.totalFrames );
    _bitmapData                         = new BitmapData( stage.stageWidth, stage.stageHeight );
    _bitmap                              = new Bitmap( _bitmapData );
    _bitmapData.draw ( stage );
    saveImageJPG( _bitmapData, "test.jpg", 96 );
    public function saveImageJPG( bitmapData:BitmapData, fileName:String, quality:int ):void {
                this.jpgEncoder = new JPGEncoder( quality );
                this.fileReference = new FileReference();
                this.fileReference.save( this.jpgEncoder.encode( bitmapData ), fileName + ".jpg" );
    Keep in mind that you need a few extra libraries to be able to create a jpeg.. (AS3CoreLib) can be found at googleCode.

  • How can you transfer files from drop box to ibooks?

    How can you transfer files from drop box to ibooks?

    These two articles should help:
    http://docs.info.apple.com/article.html?path=Mac/10.7/en/mchlp2185.html
    http://support.apple.com/kb/HT2518

  • I have a passport external hard. previously, I used it on windows, then I changed my laptop to mac. Now, It's only read. How can I use it for copying files on it on mac? I don wanna use it on windows again.

    I have a passport external hard. previously, I used it on windows, then I changed my laptop to mac. Now, It's only read. How can I use it on my mac for copying files on my passport? I don wanna use it on windows again.

    If you're not going to use the drive on a Windows machine, you should use Disk Utility (Applications>Utilities folder) to erase the drive and format it as "Mac OS Extended (Journaled)" with a single GUID partition (default):
    Good luck,
    Clinton

  • Windows Scripting to copy files

    Hi there,
    New to Windows scripting. 
    I have tried to create a simple script to copy file but failed. Most probably the syntax is wrong. Pls help. thanks.
    I give you my code below:
    @ECHO OFF
    SETLOCAL
    REM SET INDIR="\\sge-fs01\enablers_development\ptc\OUTGOING"
    SET SLIFTCMD="C:\Program Files\PrivyLink\SLIFT-Ez Classic\1.4\SLIFTC.exe"
    SET PFX="C:\PrivyLink\KeyPeer\111111.pfx"
    SET PFXPWD="pass12345"
    SET CER="C:\PrivyLink\KeyPeer\sgesftpuser.cer"
    SET PATTERN="*.IN"
    SET DSTDIR="C:\SFTP\OUTBOUND"
    SET BKDIR="C:\SFTP\BACKUP"
    SET SENDDIR="C:\SFTP\SENDTO"
    SET INDIR="C:\SFTP\PTC\OUTGOING"
    REM ####### MAIN CALL #########
    CALL:MainScript
    GOTO :EOF
    REM ####### Check Files in PTC OUTGOING #########
    :MainScript
    SETLOCAL
    @ECHO OFF
    PUSHD %INDIR%
    IF EXIST "C:\SFTP\PTC\OUTGOING\*.IN"
    COPY "C:\SFTP\PTC\OUTGOING\*.IN" %DSTDIR%
    ELSE 
    echo "There are no files today - %date:~-4,4%%date:~-7,2%%date:~-10,2%" >> C:\SFTP\PTC.log
    pushd %~dp0
    start "" cmd /c cscript SMTP.vbs
    POPD
    ENDLOCAL
    GOTO :EOF
    REM ####  END ########

    I tried myself and it works now. 
    EXISTS can use wildcard (no problem with that). Just that my brackets were not in right position.
    They should be like this:
    IF EXIST "C:\SFTP\PTC\OUTGOING\*.IN" (   
                                    COPY %INDIR%"\*.IN" %DSTDIR%
                                    REM COPY "C:\SFTP\PTC\OUTGOING\*.IN" %DSTDIR%
                                    REM CALL :ENCRYPT
                    ) ELSE (
                                    echo "There are no files today - %date:~-4,4%%date:~-7,2%%date:~-10,2%" >> C:\SFTP\PTC.log
                                    pushd %~dp0
                                    start "" cmd /c cscript SMTP.vbs

  • A script for copying certain files to a new location

    I have a folder with over 50,000 images in it. I need about 15,000 of them copied to another folder.
    Is there a script (that I can paste the list of the ones I need copied) to perform this action?
    Thanks in advance.

    perhof,
    After much googling, I was fortunate enough to find your beautiful script!
    I added a couple of things like subfolder recusion ( by tweaking scripts I found) .
    Would you be kind enough to look this over and see if it's ok or needs fixing?
    Thanks for any help,
    ec
    [code]
    ' Read a list of images from text file
    ' and copy those images from SourceFolder\SubFolders to TargetFolder
    ' Should files be overwriten if they already exist? TRUE or FALSE.
    Const blnOverwrite = TRUE
    Dim objFSO, objShell, WSHshell, objFolder, objFolderItem, strExt, strSubFolder
    Dim objFileList, strFileToCopy, strSourceFilePath, strTargetFilePath
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objShell = CreateObject("Shell.Application")
    Set WSHshell = CreateObject("WScript.Shell")
    Const ForReading = 1
    ' Make the script useable on anyone's desktop without typing in the path
    DeskTop = WSHShell.SpecialFolders("Desktop")
    strFileList = DeskTop & "\" & "images.txt"
    ' File Extension type
    strExt = InputBox("Please enter the File type" _
    & vbcrlf & "For Example: jpg or tif")
    If strExt="" Then
       WScript.Echo "Invalid Input, Script Canceled"
    Wscript.Quit
    End if
    ' Get the source path for the copy operation.
    Dim strSourceFolder
    Set objFolder = objShell.BrowseForFolder(0, "Select source folder", 0 )
    If objFolder Is Nothing Then Wscript.Quit
    Set objFolderItem = objFolder.Self
    strSourceFolder = objFolderItem.Path
    ' Get the target path for the copy operation.
    Dim strTargetFolder
    Set objFolder = objShell.BrowseForFolder(0, "Select target folder", 0 )
    If objFolder Is Nothing Then Wscript.Quit
    Set objFolderItem = objFolder.Self
    strTargetFolder = objFolderItem.Path
    Set objFileList = objFSO.OpenTextFile(strFileList, ForReading, False)
    On Error Resume Next
    Do Until objFileList.AtEndOfStream
        ' Read next line from file list and build filepaths
        strFileToCopy = objFileList.Readline & "." & strExt
        ' Check for files in SubFolders
        For Each strSubFolder in EnumFolder(strSourceFolder)
          For Each strFileToCopy in oFSO.GetFolder(strSubFolder).Files
        strSourceFilePath = objFSO.BuildPath(strSubFolder, strFileToCopy)
        strTargetFilePath = objFSO.BuildPath(strTargetFolder, strFileToCopy)
        ' Copy file to specified target folder.
        Err.Clear
        objFSO.CopyFile strSourceFilePath, strTargetFilePath, blnOverwrite
        If Err.Number = 0 Then
            ' File copied successfully
            iSuccess = iSuccess + 1
            If Instr(1, Wscript.Fullname, "cscript.exe", 1) > 0 Then
                ' Running cscript, output text to screen
                Wscript.Echo strFileToCopy & " copied successfully"
            End If
        Else
            ' Error copying file
            iFailure = iFailure + 1
            TextOut "Error " & Err.Number & _
            " (" & Err.Description & ")trying to copy " & strFileToCopy
        End If
       Next
    Next
    Loop
    strResults = strResults + 0 '& vbCrLf
    strResults = strResults & iSuccess & " files copied successfully." & vbCrLf
    strResults = strResults & iFailure & " files generated errors" & vbCrLf
    Wscript.Echo strResults
    Sub TextOut(strText)
        If Instr(1, Wscript.Fullname, "cscript.exe", 1) > 0 Then
            ' Running cscript, use direct output
            Wscript.Echo strText
        Else
            strResults = strResults & strText & vbCrLf
        End If
    End Sub
    Function EnumFolder(ByRef vFolder)
    Dim oFSO, oFolder, sFldr, oFldr
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    If Not IsArray(vFolder) Then
    If Not oFSO.FolderExists(vFolder) Then Exit Function
    sFldr = vFolder
    ReDim vFolder(0)
    vFolder(0) = oFSO.GetFolder(sFldr).Path
    Else sFldr = vFolder(UBound(vFolder))
    End If
    Set oFolder = oFSO.GetFolder(sFldr)
    For Each oFldr in oFolder.Subfolders
    ReDim Preserve vFolder(UBound(vFolder) + 1)
    vFolder(UBound(vFolder)) = oFldr.Path
    EnumFolder vFolder
    Next
    EnumFolder = vFolder
    End Function
    [/code]

  • A script for copying smilar files to a new location

    Hi,
    i newbies to scripting. My challenge is that I want a script to only copy files with names "similar" and not "exactly the same" as the filenames in the text file.
    For example some files have 10 letters file name like "ABC01FGH01.tif".  I have to copy file where starting letter "ABC" and middle letter "FGH" of file name are fixed, but other letters are changed.
    The script sees a file name like "ABC**FGH**.tif", it should search the source location and copy the files having filenames with at least this characters e.g. "ABC02FGH02.tif", "ABC03FGH04.tif" should be copied since it has
    contains "ABC**FGH**.tif".
    Please help.

    Learn how to use wildcards in file names.  '*' is for any number of characters and'?' is for one character.
    COPY ABC??DE???.?x? c:\target
    Start by using DIR
    DIR ABC??DEF???JK.?x?
    ¯\_(ツ)_/¯

  • Do scirpt for copy file

    for(var a=0;a<myDoc.links.length;a++){
                var  f = File(myDoc.links[a].filePath);
                var fname = f.name;
                copyPasteScript = "tell application \"Finder\"\r";
               copyPasteScript += "copy file \""+myDoc.links[a].filePath+"\" to folder \""+ArtFolder+"\"\r";
                copyPasteScript += "end tell";
                app.doScript(copyPasteScript, ScriptLanguage.applescriptLanguage);
                var f2 = File(ArtFolder+"/"+fname);
                myDoc.links[a].relink(f2);
                myDoc.links[a].update();
    it throws error in the highlighted line what to do....

    Why NOT use ID's links copyLink to folder? No need to involve AppleScript and Finder…
    #target indesign
    var userHome = Folder('~').fsName.toString();
    var linksFolder = userHome + '/Desktop/ID Links/';
    myLinks = CreateFolder(linksFolder);
    main();
    function main() {
    if (app.documents.length == 0) {
    alert('Please have an "Indesign" document before running this script.');
    return;
    docRef = app.activeDocument;
    with(docRef) {
    for (var i = 0; i < links.length; i++) {
    links[i].copyLink(myLinks);
    function CreateFolder(Directory) {
    var folderPath = new Folder(Directory);
    if (folderPath.exists == false) {
    folderPath.create();
    return folderPath;

  • HT4283 How do I save a copy to my drop box?

    I need help . How do I up load from numbers to my drop bax

    Open Numbers to the file view
    Tap the the file action icon (box with an arrow; upper right)
    Select Open in another app
    Tap teh icon for the specific spreadsheet
    Select the file format
    Tap Choose App
    Select DropBox from the icon list (you may have to swipe to find it depending on the number of apps you have)
    Drop box should open Tap ave location (DropBox, unless you have additional WbDav locations associated)
    Seelct a folder
    Tap Choose (lower left of the list)
    Tap SAVE

  • Script for downloading files from pdf placed on web, script for printing for exchange-

    Looking for java script command to set on button in pdf. We have mp3 and pdfs on our web site, example of URL: http://www.uzlicek.cz/download/Pohadky/O_holcicce_ktera_si_prala_byt_dospela.mp3
    By clicking on button/link in reader I would like to appear a dialog box with offer to Safe file as…
    Any suggestion? In case of using “link tool” the file starts downloading to cache and this is not the objective. In case of using “sound tool”, the file does not appear for saving.
    For exchange the script for Print the current page:
       var n = this.pageNum;
        var pp = this.getPrintParams();
        //pp.pageSubset = pp.subsets.all;
        //pp.printContent = pp.constants.printContent.doc;
        pp.firstPage = n;
        pp.lastPage = n;
        this.print(pp);
    Cheers Martin

    It can't be done using only a PDF file - any link to a URL will simply open your web browser, and whatever handler that browser uses when presented with MP3 files will be triggered (download, play, etc.) - nothing in the PDF can override that handler and force a "save" operation.
    Instead you'll need to configure your website to force downloads (using HTTP headers) and link to those URLs instead; which is a subject outside this forum.

  • Sharing Problems---dropping files in "drop box" renders them locked

    Hi,
    I have a few macs on my home network and often share files between them. I sometimes use my iPod but since it's getting full, I also just connect to the other machines (file sharing is on) and drop it in the public>drop box folder.
    I hadn't done this in a while, but I've definitely noticed this after the 10.4.4 update (can't say one way or another of 10.4.3 gave me troubles or not), certain folders that I drop into another machine's drop box say that I do not have the correct permissions to open them. Sometimes they have the "no read/no write" folder icon on them, othertimes they have a "blue arrow" write only icon on them...on the file's native machine, they have all permissions allowed. I noticed that if i get info on such a folder to view permissions, it says the owner is "nobody" and that it is locked-- I can unlock them using my admin password, which is fine because then i can use the files... but I'd rather not have to go through every single shared folder and unlock them individually just to open a few files.

    Apple doesn’t routinely monitor the discussions. These are mostly user to user discussions.
    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback

Maybe you are looking for

  • Photoshop CS4 corrupted file while save to OS X 10.5 Server

    Hello We have or Leopard OS X Server running for months. Running CS3 Clients on 10.4.11 without any problems. A couple of weeks ago we swapped to 10.5 Clients and all Photoshop where corrupted when using "save", the "save as" works fine. After some d

  • 2 Iphones, 1 Itunes lost ringtones

    Both my wife and I have Iphones with our own itunes accounts. We have itunes on our PC and use this for our downloads etc. The problem i have is that my wife has purchased 2 ringtones from Itunes (downloaded straight to phone) which worked fine until

  • Is there any way to make location codes a user maintenance function?

    Are volume of new location codes that the business adds to all company codes is taking too much development time.  Is there any way to update the table to be handled by the business without transports?

  • Site actions not showing

    Hi all, The site actions have been taken off a website and are not showing even though I am logged on as a user with design and contribute permisssions. It only shows view all site content??? Any guidance would be great.

  • What the function of product allocation firming

    hi gurus, a question about prodcut allocation. in mc94, what's the function in setting - firming: the switch-on, swich-off and unfirm period? is there anyone has some idea on that. thanks a lot.