Ändern Sie den Standardnamen für „Neuer Ordner“.

Wenn wir im Finder einen „neuen Ordner“ erstellen, wird er automatisch „unbenannter Ordner“ genannt.

Ist es möglich, diesen Standardordnernamen in den aktuellen Datumsnamen zu ändern, z. B. "20151223"?

@MrMojoRisin Dies erlaubt jedoch keine dynamischen Ordnernamen basierend auf dem Datum.

Antworten (1)

Mit Hilfe von AppleScript können Sie dies bewerkstelligen.

Öffnen Sie den AppleScript Editor, erstellen Sie ein neues Dokument und fügen Sie die folgenden gestohlenen Zeilen ein:

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

Speichern Sie die Datei als AppleScript-Anwendung (zB DateFolder.app) irgendwo (zB ~/Applications).

Öffnen Sie einen Ordner und legen Sie die DateFolder.app auf der Symbolleiste ab:

Finder-Symbolleiste

Um einen Ordner in einem geöffneten Ordner zu erstellen, klicken Sie einfach auf das Symbol der App in der Symbolleiste. Der neue Ordner wird automatisch geöffnet. Entfernen Sie Zeile 22 im Skript ( open y), wenn Sie nicht möchten, dass der neue Ordner geöffnet wird. Wenn Sie die App zum Dock hinzufügen und öffnen, wird ein neuer Ordner im vordersten Ordner oder auf dem Desktop erstellt (wenn kein Ordner geöffnet ist).

Nur unter Mac OS X 10.7.5 getestet. Löwe!


Um einen Bindestrich und die aktuelle Uhrzeit hinzuzufügen, fügen Sie die folgenden Zeilen hinzu (ersetzen Sie Zeile 32-34 im obigen Skript):

        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)
Sie können die Anwendung „foldermaker.app“ nicht öffnen, da PowerPC-Anwendungen nicht mehr unterstützt werden. Ausführen von 10.11.2 (15C50).