Actualmente estoy usando esto ( http://lifehacker.com/193778/download-of-the-day--auto+applescript-tickler-file ) para un sistema de archivos tickler y lo tengo configurado en mi Dropbox (para que funcione en sistemas). Solo hay un par de cosas para hacerlo perfecto. Si alguien me puede ayudar sería excelente.
Lo que busco es un script o flujo de trabajo que tome los contenidos de las carpetas del día anterior (cambian cada día y están numerados) y los mueve al día actual. Entonces puedo configurarlo como una alarma para que funcione en la mañana todos los días.
Muchas gracias.
Si entiendo sus requisitos correctamente, entonces este script debería hacer lo que desea. Asegúrese de cambiar el nombre de usuario en la primera línea a su nombre de usuario.
set username to "lizzan"
set cy to (year of (current date)) as integer
set cm to (month of (current date)) as integer
set cd to (day of (current date)) as integer
set yd to yesterday(cy, cm, cd)
set yy to item 1 of yd
set ym to item 2 of yd
set yd to item 3 of yd
set yFolder to "Macintosh HD:Users:" & username & ":Documents:To Do:" & yy & ":" & ym & ":" & yd
set cFolder to "Macintosh HD:Users:" & username & ":Documents:To Do:" & cy & ":" & cm & ":" & cd
tell application "Finder"
move every file of folder yFolder to cFolder
end tell
on yesterday(y, m, d)
set d to d - 1
if d ≤ 0 then
set m to m - 1
if m ≤ 0 then
set y to y - 1
set m to 12
end if
set thirtyones to {1, 3, 5, 7, 8, 10, 12}
set thirties to {4, 6, 9, 11}
if m is in thirtyones then
set d to 31
else if m is in thirties then
set d to 30
else if leapyear(y) then
set d to 29
else
set d to 28
end if
end if
set yd to {y, m, d}
return yd
end yesterday
on leapyear(y)
if y mod 4 is 0 then
if y mod 100 is 0 then
if y mod 400 is 0 then
return true
end if
return false
end if
return true
end if
return false
end leapyear
Advertencia: el script fallará (y posiblemente haya movido solo algunos de sus archivos) si ya hay un archivo con el mismo nombre en la carpeta a la que se está moviendo. Si desea reemplazar los archivos en ese caso y evitar fallas, agregue with replacing
al final de la línea 18 ( move every ... to cFolder with replacing
).
Edite para agregar: Oh, acabo de ver que lo tenía configurado en su Dropbox en lugar de en la carpeta Documentos. Simplemente cambie las rutas en las líneas 14 y 15 para reflejar la ruta que está utilizando, y debería estar bien.
Una solución muy simple es una aplicación Automator (flujo de trabajo que se ejecuta de forma independiente). Tomó alrededor de 15 segundos (literalmente) configurar este flujo de trabajo:
Sulcalibur
Lizzan