Odpowiedz na ten temat
Pokaż wyniki od 1 do 1 z 1
  1. Avatar molsar
    Dołączył
    Sep 2008
    Postów
    251

    Cytuj | #1

    hej,
    czy jest mozliwosc ustawienia automatora w 10.5.8 tak, aby:
    1. kopiowal folder i jego zawartosc ale tylko pliki typu np.: XML

    czyli folder zawiera 100 plikow tiff oraz 90 XML w podfolderach tez.
    chce miec jego dokladna kopie (razem ze struktura podfolderow) na pulpicie ale zawirajaca tylko pliki XML...

    oczywiscie zadanie typu: kopiowanie calego folderu ze wszystkim a potem znajdowanie plikow tiff i ich kasowanie czwgo wynikiem by bylo pozostawienie samych plikow XML - nie wchodzi w gre - bo nie mam dodatkowych 500GB na takie kopie...


    znalazlem bardzo fajnego gotowca...ale problem pojawia sie wtedy gdy chce skopiowac "wycedzona strukture folderow" na miejsce, gdzie juz jest identyczna ale np. nie zawierajaca jednego z plikow w ktoryms z podfolderow.
    tzn. ten zalaczony skrypt poprostu jak widzi w miejscu przeznaczenia taka sama strukture to anuluje cale zadanie a nie dopisuje dane ktorych w destynacji nie bylo.... macie pomysl jak to dodac zeby dogrywal te brakujace pliki??


    ---------------------------------------------------------------------------------------
    -- Copy folder tree
    -- by Jeff Fischer <jeff@5fischers.org>
    --
    -- credit to Dan Decker and Robert Metzker for ideas from their scripts
    ---------------------------------------------------------------------------------------

    -- make gFileTypes an empty set to omit copying/moving any files
    property gFileTypes : {"xml"}

    tell application "Finder"
    set tSourceFolder to choose folder with prompt "Choose a folder structure to duplicate"
    if tSourceFolder is false then return "User Cancelled"
    set tDestFolder to choose folder with prompt "Choose the location for the duplicate structure"
    if tDestFolder is false then return "User Cancelled"

    my copyItems(tSourceFolder, tDestFolder)
    end tell

    on copyItems(pSourceFolder, pDestFolder)
    tell application "Finder"
    set tSourceFolderName to name of pSourceFolder as string
    make new folder at pDestFolder with properties {name:tSourceFolderName}
    set tNewDestFolder to (folder tSourceFolderName of folder pDestFolder) as alias

    -- copy or move over files of the specified type(s)
    set tSelectedFiles to (every file of folder pSourceFolder whose name extension is in gFileTypes)
    if tSelectedFiles ≠ {} then
    select (every file of folder pSourceFolder whose name extension is in gFileTypes)
    try
    -- uncomment the action you want, either copy or move
    -- copy the selection to folder tNewDestFolder
    move the selection to folder tNewDestFolder
    close window (name of folder pSourceFolder as string)
    end try
    end if

    -- copy over the folders, calling this handler recursively
    set tFolders to (every folder of pSourceFolder)
    repeat with tThisFolder in tFolders
    my copyItems(tThisFolder as alias, tNewDestFolder as alias)
    end repeat
    end tell
    end copyItems
    Ostatnio edytowane przez molsar ; 30.10.2009 o 21:59


Odpowiedz na ten temat