Cambia il nome predefinito 'Nuova cartella'


Risposte:


17

Con l'assistenza di AppleScript puoi farlo.

Apri AppleScript Editor, crea un nuovo documento e incolla le seguenti linee rubate :

tell application "Finder"
    try
        if exists Finder window 1 then
            set thisPath to (the target of the front window) as alias
        else
            set thisPath to (path to desktop)
        end if
    on error
        return
    end try
end tell
set x to my the_perfect_datestring()
if x is not "-ERROR" then
    set fullPath to thisPath & x as text
    tell application "Finder"
        try
            --activate
            if not (exists fullPath) then
                set y to make new folder at thisPath with properties {name:x}
            end if
            activate
            open y
        end try
    end tell
end if
on the_perfect_datestring()
    try
        set cd to (the current date)
        set the_year to year of (cd) as number
        set the_month to month of (cd) as number
        set the_day to day of (cd) as number
        if the_month < 10 then set the_month to "0" & the_month
        if the_day < 10 then set the_day to "0" & the_day
        return ((the_year & the_month & the_day) as string)
    on error
        return "-ERROR"
    end try
end the_perfect_datestring

Salvare il file come applicazione AppleScript (ad esempio DateFolder.app) da qualche parte (ad esempio ~ / Applicazioni).

Apri una cartella e rilascia DateFolder.app sulla barra degli strumenti:

Barra degli strumenti del Finder

Per creare una cartella in una cartella aperta basta premere l'icona dell'app nella barra degli strumenti. La nuova cartella si aprirà automaticamente. Rimuovere la riga 22 nello script ( open y) se non si desidera aprire la nuova cartella. Se aggiungi l'app al Dock e la apri, creerà una nuova cartella nella cartella in primo piano o sul desktop (se nessuna cartella è aperta).

Testato solo su Mac OS X 10.7.5. Leone!


Per aggiungere un trattino e l'ora corrente aggiungere le seguenti righe (sostituendo la riga 32-34 nello script sopra):

        set the_hour to hours of (cd) as number
        set the_minute to minutes of (cd) as number
        set the_second to seconds of (cd) as number
        if the_month < 10 then set the_month to "0" & the_month
        if the_day < 10 then set the_day to "0" & the_day
        if the_hour < 10 then set the_hour to "0" & the_hour
        if the_minute < 10 then set the_minute to "0" & the_minute
        if the_second < 10 then set the_second to "0" & the_second
        return ((the_year & the_month & the_day & "-" & the_hour & the_minute & the_second) as string)

Non è possibile aprire l'applicazione "foldermaker.app" perché le applicazioni PowerPC non sono più supportate. In esecuzione 10.11.2 (15C50).
Gaurav Gandhi,
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.