IPB     Il futuro di Tevac dipende da te!  

Benvenuto Visitatore ( Log In | Registrati )

  · · · · · · · · · · · ·
Reply to this topicStart new topic
> Script che crea cartelle per data, script da applicare alla cartella download
ARTU
messaggio 14 Mar 2008, 11:18
Messaggio #1


Level 1/11
*

Gruppo: Forum User
Messaggi: 27
Iscritto il: 7-September 07
Utente Nr.: 8.703



Tempo fa (dovrei dire anni fa) avevo trovato uno script da applicare ad una cartella che nel momento in cui si trasferiva un file al suo interno lo script posizionava il file all'interno di una nuova cartella che creava lo script stesso e che nominava con la data corrente. Applicato questo script alla cartella downolad mi trovavo una serie di cartelle ordinate e nominate per data (tipo "2008 Marzo 14") contenenti i vari download effettuati. il tutto era molto ordinato e mi permetteva di controllare agevolmente file + vecchi. Ovviamente scrivo perché ho perduto la cartella e non trovo + lo script in questione. Avete informazioni al riguardo?
Grazie
Max
Go to the top of the page
 
+Quote Post
poweruser
messaggio 16 Mar 2008, 00:51
Messaggio #2


MacInATopic
Gruppo icone

Gruppo: Root Admin
Messaggi: 24.319
Iscritto il: 27-July 03
Da: Maglie (LE)
Utente Nr.: 440



Se hai solo buttato la cartella, lo script dovresti ancora averlo in ~/Library/Scripts/Folder Action Scripts.

Ciao
Paolo


--------------------
Paolo Portaluri

guru, n: A computer owner who can read the manual.
Go to the top of the page
 
+Quote Post
ARTU
messaggio 18 Mar 2008, 14:21
Messaggio #3


Level 1/11
*

Gruppo: Forum User
Messaggi: 27
Iscritto il: 7-September 07
Utente Nr.: 8.703



purtroppo ho fatto una nuova installazione del sistema ed ho cancellato il vecchio...
cmq grazie
Max
Go to the top of the page
 
+Quote Post
chebfarid
messaggio 18 Mar 2008, 22:41
Messaggio #4


Level 8/11
********

Gruppo: Supporter
Messaggi: 3.763
Iscritto il: 11-July 03
Da: Milano
Utente Nr.: 395



Quick and dirty, ma dovrebbe funzionare:
CITAZIONE
on adding folder items to this_folder after receiving these_items
     set dateString to ((year of (current date)) & "-" & (month of (current date)) & "-" & day of (current date)) as string
     repeat with anItem in these_items
          tell application "Finder"
               if not (exists folder dateString of this_folder) then
                    set dateFolder to (make new folder at this_folder with properties {name:dateString})
                    move anItem to dateFolder
               else
                    set dateFolder to folder dateString of this_folder
                    move anItem to dateFolder
               end if
          end tell
     end repeat
end adding folder items to
-------------------------
[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Da attaccare come "Azione cartella" alla cartella desiderata.

Buon scripting
Farid


--------------------
Abends lustig, morgens triste
das ist Leben von Artiste
Go to the top of the page
 
+Quote Post
pulce15
messaggio 19 Mar 2008, 17:48
Messaggio #5


Level 1/11
*

Gruppo: Forum User
Messaggi: 31
Iscritto il: 9-November 07
Utente Nr.: 9.042



CITAZIONE(chebfarid @ 18 Mar 2008, 21:41) *
Quick and dirty, ma dovrebbe funzionare:
CITAZIONE
on adding folder items to this_folder after receiving these_items
     set dateString to ((year of (current date)) & "-" & (month of (current date)) & "-" & day of (current date)) as string
     repeat with anItem in these_items
          tell application "Finder"
               if not (exists folder dateString of this_folder) then
                    set dateFolder to (make new folder at this_folder with properties {name:dateString})
                    move anItem to dateFolder
               else
                    set dateFolder to folder dateString of this_folder
                    move anItem to dateFolder
               end if
          end tell
     end repeat
end adding folder items to
-------------------------
[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Da attaccare come "Azione cartella" alla cartella desiderata.

Buon scripting
Farid


Farid sei sempre un grande!
Go to the top of the page
 
+Quote Post
ARTU
messaggio 22 Mar 2008, 11:33
Messaggio #6


Level 1/11
*

Gruppo: Forum User
Messaggi: 27
Iscritto il: 7-September 07
Utente Nr.: 8.703



CITAZIONE(pulce15 @ 19 Mar 2008, 16:48) *
CITAZIONE(chebfarid @ 18 Mar 2008, 21:41) *
Quick and dirty, ma dovrebbe funzionare:
CITAZIONE
on adding folder items to this_folder after receiving these_items
     set dateString to ((year of (current date)) & "-" & (month of (current date)) & "-" & day of (current date)) as string
     repeat with anItem in these_items
          tell application "Finder"
               if not (exists folder dateString of this_folder) then
                    set dateFolder to (make new folder at this_folder with properties {name:dateString})
                    move anItem to dateFolder
               else
                    set dateFolder to folder dateString of this_folder
                    move anItem to dateFolder
               end if
          end tell
     end repeat
end adding folder items to
-------------------------
[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]

Da attaccare come "Azione cartella" alla cartella desiderata.

Buon scripting
Farid


Farid sei sempre un grande!

Straquoto!!!
lo sapevo che qui avrei trovato la soluzione! Grazie 1000

Messaggio modificato da ARTU il 22 Mar 2008, 12:02
Go to the top of the page
 
+Quote Post
Wave
messaggio 22 Mar 2008, 20:40
Messaggio #7


Level 2/11
**

Gruppo: Forum User
Messaggi: 52
Iscritto il: 30-March 05
Utente Nr.: 3.448



WOW ottimo script...veramente utile. Non ne so molto di Applescript ma mi chiedevo se questo processasse solo i file aggiunti nella cartella ~/Download o anche quelli che vengono aggiunti in sottocartelle di quest'ultima??

mi spiego meglio...in Download io ho anche la cartella dove vanno a finire i file che scarico con torrent etc..come si comporta lo script nel caso dell'aggiunta di un file in quella cartella???
Go to the top of the page
 
+Quote Post
poweruser
messaggio 23 Mar 2008, 18:21
Messaggio #8


MacInATopic
Gruppo icone

Gruppo: Root Admin
Messaggi: 24.319
Iscritto il: 27-July 03
Da: Maglie (LE)
Utente Nr.: 440



Le azioni cartella reagiscono solo al contenuto della cartella stessa e non ai cambiamenti delle sottocartelle.
Però puoi sempre associare l'azione cartella anche alle sottocartelle.
Supponiamo che i file torrent vengano salvati in ~/Downloads/Torrent. Se vuoi che i file scaricati in Torrents vadano a finire nelle sottocartelle di Download, puoi modificare lo script di Farid in
CODICE
on adding folder items to this_folder after receiving these_items
    tell application "Finder"
        set parent_folder to parent of this_folder
        set dateString to ((year of (current date)) & "-" & (month of (current date)) & "-" & day of (current date)) as string
        repeat with anItem in these_items
            if not (exists folder dateString of parent_folder) then
                set dateFolder to (make new folder at parent_folder with properties {name:dateString})
            else
                set dateFolder to folder dateString of parent_folder
            end if
            move anItem to dateFolder
        end repeat
    end tell
end adding folder items to


Ciao
Paolo


--------------------
Paolo Portaluri

guru, n: A computer owner who can read the manual.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 

Collapse

> 

    Titolo discussione Risposte Autore discussione Visite Ultima azione
No New Posts   8 pulce15 99 13 November 2008 - 16:32
Ultimo messaggio di: chebfarid
No New Posts   6 jimmi 92 30 October 2008 - 00:41
Ultimo messaggio di: jimmi
No new   16 alebopp 10.565 23 October 2008 - 18:12
Ultimo messaggio di: cesri
No New Posts   1 dadomen 138 14 October 2008 - 23:25
Ultimo messaggio di: Martini
No New Posts   2 giorgio 180 19 September 2008 - 11:25
Ultimo messaggio di: akko69
No New Posts   4 Marco.Bischero 135 19 September 2008 - 01:38
Ultimo messaggio di: Marco.Bischero
No New Posts   2 robbur 103 18 September 2008 - 14:04
Ultimo messaggio di: robbur
No New Posts   7 sgang 288 15 September 2008 - 16:03
Ultimo messaggio di: Celeborn
No New Posts   1 TevacPhoto 68 8 September 2008 - 11:10
Ultimo messaggio di: pphoto
No New Posts   1 fede86 160 27 August 2008 - 20:39
Ultimo messaggio di: poweruser
No New Posts   5 Tevac Staff 280 27 August 2008 - 18:09
Ultimo messaggio di: Andrea Mattei
No New Posts   1 alby83 129 9 August 2008 - 21:09
Ultimo messaggio di: poweruser

Modalità di visualizzazione: Normale · Passa a: Lineare · Passa a: Outline


RSS Versione Lo-Fi Oggi è il: 22 November 2008 - 10:09
IP.Board Skin Developed By Creative Networks