Conecta
Nido Apple
Recibe ayuda de expertos
Registrate y pregunta
Es gratis y fácil
Recibe respuestas
Respuestas, votos y comentarios
Vota y selecciona respuestas
Recibe puntos, vota y da la solución
Pregunta
No logro iniciar un SCRIPT desde una regla de MAIL
- preguntó
- macOS y Mac
- 181 Vistas
- 4 Respuestas
- abierta
Tengo una regla en MAIL que cuando me llega el extracto bancario, mueve el e.mail recibido a una carpeta TEMPORAL y luego ejecuta el siguiente SCRIPT, que imprime el EXTRACTO recibido.
El siguiente SCRIPT no opera. Al llegar a: on getWorkflowFolder(), ejecuta solamente el comando: display dialog "entro".
Cuando ejecuto este SCRIPT desde el Editor de Scripts me funciona correctamente si elimino las instrucciones on perform mail action with messages theMessages y end perform mail action with messages.
Sus recomendaciones para resolver este inconveniente son bienvenidas.
Mi equipo es un MacBook Pro I7 Mac OS X Versión 10.6.5.
Cordialmente,
Hdmesa
===========================================================
on perform mail action with messages theMessages
display dialog "Iniciando"
set theWorkflowFolder to getWorkflowFolder()
if theWorkflowFolder = false then return
repeat with aMessage in theMessages
try
set theSubject to getMessageSubject(aMessage)
set theWorkflow to getWorkflow(theSubject, theWorkflowFolder)
if theWorkflow is not equal to false then do shell script "automator " & theWorkflow
end try
end repeat
end perform mail action with messages
end using terms from
on getWorkflowFolder()
display dialog "entro"
tell application "Finder"
display dialog "entro a subrutina"
set theLibraryFolder to path to library folder from user domain as string
display dialog theLibraryFolder
set theWorkflowFolder to theLibraryFolder & "Workflows:Mail Rules:"
display dialog theWorkflowFolder
if (folder theWorkflowFolder exists) = false then return false
display dialog "Hello3"
return theWorkflowFolder
end tell
end getWorkflowFolder
on getMessageSubject(aMessage)
tell application "Mail" to return subject of aMessage
end getMessageSubject
on getWorkflow(theSubject, theWorkflowFolder)
if theSubject does not start with "Extracto - <" then return false
set theWorkflowName to "ImprimeExtractoBancarioCitibank"
set theCurrentWorkflowPath to theWorkflowFolder & theWorkflowName & ".workflow"
tell application "Finder"
if (item theCurrentWorkflowPath exists) = false then return false
end tell
return quoted form of POSIX path of theCurrentWorkflowPath
end getWorkflow
4 Respuestas
Por favor, accede o regístrate para añadir un comentario.
Tengo una regla en MAIL definida que hace que tan pronto como entra un e.mail que tenga en el SUBJECT los caracteres "Extracto -" y sea remitido por una dirección de e.mail específica, traslada el e.mail recibido a un folder de e.mail llamado TEMPORAL y luego ejecuta el script ~/Library/Scripts/LaunchAutomatorWorkflow.scpt.
Este escript está almacenado en /Users/hdmesa/Library/Scripts con el nombre LaunchAutomatorWorkflow.scpt.
Gracias,
Hdmesa
Por favor, accede o regístrate para añadir un comentario.
Por favor, accede o regístrate para añadir un comentario.
Por favor, accede o regístrate para añadir un comentario.
Por favor, accede o regístrate para responder a esta pregunta.
En el blog
-
- 52202
- 1
- Ago 31, 2017
Otras Preguntas y Respuestas
- entre Desarrolladores (Desarrolladores)
Respuestas WordPress (Usuarios WordPress)
Sin Respuesta
-
- 7
- 0
- hace 1 día
-
- 42
- 0
- Feb 23
-
- 98
- 0
- Dic 7, 2023
-
- 101
- 0
- Nov 30, 2023
-
- 439
- 0
- Jul 7, 2023
-
- 615
- 0
- Ago 4, 2022
-
- 647
- 0
- Feb 25, 2022
-
- 738
- 1
- Ene 1, 2022
- ver todas
Actividad Reciente
DaleGarrote preguntó hace 1 día
Liada con biblioteca de MusicaDaleGarrote comentó Mar 18
renombrar,organizar fotosppenagosr respondió Mar 15
renombrar,organizar fotosDaleGarrote respondió Mar 15
MacBookPro con Wifi dañadaDaleGarrote respondió Mar 15
renombrar,organizar fotos
Ultimas Respuestas
ppenagosr respondió
Muchas gracias por tu respuesta; cometí el error
0DaleGarrote respondió
La solución: pillé una tarjeta AirPort por eBay,
0DaleGarrote respondió
Prueba con Adobe Bridge, entre otras cosas, te per
0DaleGarrote respondió
No doy en la tecla, como os comenté la App UltDat
0DaleGarrote respondió
Bueno, cuento como sigue el tema. Pude resolver el
0DaleGarrote respondió
0Peter respondió
No es posible, pero si pones a codificar algún vi
0Ultimos Comentarios
...