Puede que no sea la solución perfecta, pero esta AppleScript copiará el texto seleccionado y lo añadirá a su Nota. A continuación, cambiará el tamaño de la fuente de todo el contenido de la nota al tamaño que desee.
Todo lo que tiene que hacer es insertar el nombre de su Nota y el tamaño de fuente deseado de todo el contenido de esa Nota... En la primera línea del siguiente código.
Solución 1:
addToNotesAndEditFontSize("My Note", 12) -- Insert Note Name & Size For All Fonts
on addToNotesAndEditFontSize(noteName, fontSize)
tell application "System Events" to keystroke "c" using {command down}
delay 0.1
tell application "Notes" to set body of note noteName to ¬
body of note noteName & linefeed & (the clipboard of me)
tell application "Notes" to set noteBody to body of note noteName
set editedNoteBody to (do shell script "echo " & quoted form of ¬
noteBody & " |sed -E 's@font-size: .px|font-size: ..px@font-size: " & ¬
fontSize & "px@g'")
tell application "Notes" to set body of note noteName to editedNoteBody
end addToNotesAndEditFontSize
Llevando obsesivamente este proyecto un paso más allá... Lo siguiente AppleScript muestra un diálogo que le permite elegir una Nota para adjuntar el portapapeles, de una lista de todas sus Notas NO protegidas por contraseña. Entonces copiará el texto seleccionado y lo añadirá a su nota. Luego muestra un diálogo que le permite insertar el tamaño del texto de su Nota. A continuación, cambiará el tamaño de la fuente de todo el contenido de la nota al tamaño que desee.
Solución 2:
Ahora puedes apuntar a cualquier nota que quieras sin tener que editar nada del código.
tell application "System Events" to keystroke "c" using {command down}
delay 0.1
tell application "Notes" to set allNoteNames to name of every note ¬
whose password protected is false
activate
set noteName to (choose from list allNoteNames ¬
with title "Choose A Note" with prompt ¬
"Choose A note to be edited" OK button name ¬
"OK" cancel button name "Cancel") as text
if noteName is "false" then return
activate
set fontSize to text returned of (display dialog ¬
"Insert desired text size (Numbers Only)" default answer ¬
"12" buttons {"Cancel", "OK"} default button 2 ¬
cancel button 1 with title "Choose Font Size") as number
addToNotesAndEditFontSize(noteName, fontSize)
on addToNotesAndEditFontSize(noteName, fontSize)
tell application "Notes" to set body of note noteName to ¬
body of note noteName & linefeed & linefeed & (the clipboard of me)
tell application "Notes" to set noteBody to body of note noteName
set editedNoteBody to (do shell script "echo " & quoted form of ¬
noteBody & " |sed -E 's@font-size: .px|font-size: ..px@font-size: " & ¬
fontSize & "px@g'")
tell application "Notes" to set body of note noteName to editedNoteBody
end addToNotesAndEditFontSize
![enter image description here]()
Solución 3:
Según la petición de un comentario...
¿Sería posible elegir una nota determinada, y hacer que el sistema recuerde mi selección para ese nombre de nota en particular para todo el día sin tener que seleccionarla cada vez (ya que estaré pegando en la misma nota durante un período de tiempo?
La primera vez que ejecute esta versión del código siguiente, se le pedirá que elija la nota a editar y el tamaño de la fuente... Al igual que en el código de arriba Solución 2 . Entonces sus elecciones se escribirán en un archivo temporal llamado "notesTMP.txt". Esta es la ruta del archivo... "Macintosh HD:privado:tmp:notasTMP.txt".
Mientras exista el archivo "notesTMP.txt", ahora cada vez que ejecute este código, ya no tendrá que elegir la Nota o su tamaño de letra. El código lee ese archivo "notesTMP.txt" para el nombre de la Nota y el tamaño de la fuente y continúa.
No me cites, pero estoy bastante seguro de que los archivos en tu carpeta "Macintosh HD:private:tmp" son considerados archivos temporales por el sistema y si un archivo en esa carpeta no ha sido editado en las últimas 24 horas, se elimina automáticamente después de un reinicio. Si necesitas reiniciar el código para que te pida de nuevo que elijas la Nota y el tamaño de la letra... Sólo tienes que borrar tú mismo el archivo "Macintosh HD:private:tmp:notesTMP.txt".
property tempFile : "Macintosh HD:private:tmp:notesTMP.txt"
tell application "System Events" to keystroke "c" using {command down}
delay 0.1
try
alias tempFile
on error errMsg number errNum
tell application "Notes" to set allNoteNames to name of every note ¬
whose password protected is false
activate
set noteName to (choose from list allNoteNames ¬
with title "Choose A Note" with prompt ¬
"Choose A note to be edited" OK button name ¬
"OK" cancel button name "Cancel") as text
if noteName is "false" then return
activate
set fontSize to text returned of (display dialog ¬
"Insert desired text size (Numbers Only)" default answer ¬
"12" buttons {"Cancel", "OK"} default button 2 ¬
cancel button 1 with title "Choose Font Size") as number
addToNotesAndEditFontSize(noteName, fontSize)
do shell script "echo " & quoted form of noteName & ¬
" > " & quoted form of POSIX path of tempFile
do shell script "echo " & fontSize & " >> " & ¬
quoted form of POSIX path of tempFile
return
end try
set noteName to paragraph 1 of (read alias tempFile)
set fontSize to paragraph 2 of (read alias tempFile) as number
try
addToNotesAndEditFontSize(noteName, fontSize)
on error errMsg number errNum
display alert "Choose Different Note" message ¬
"Your original Note no longer exists. Please choose a different Note." as ¬
critical buttons {"Cancel", "OK"} default button 2 cancel button 1
do shell script "rm " & quoted form of POSIX path of tempFile
run me
end try
on addToNotesAndEditFontSize(noteName, fontSize)
tell application "Notes" to set body of note noteName to ¬
body of note noteName & linefeed & linefeed & (the clipboard of me)
tell application "Notes" to set noteBody to body of note noteName
set editedNoteBody to (do shell script "echo " & quoted form of ¬
noteBody & " |sed -E 's@font-size: .px|font-size: ..px@font-size: " & ¬
fontSize & "px@g'")
tell application "Notes" to set body of note noteName to editedNoteBody
do shell script "afplay '/System/Library/Sounds/Glass.aiff'"
end addToNotesAndEditFontSize