Skip to content

Instantly share code, notes, and snippets.

@MrCirdo
Last active December 9, 2016 15:05
Show Gist options
  • Save MrCirdo/bd6868aea3d835e0ce99a33e60376d24 to your computer and use it in GitHub Desktop.
Save MrCirdo/bd6868aea3d835e0ce99a33e60376d24 to your computer and use it in GitHub Desktop.
Un petit applescript qui automatiquement déchiffre les messages reçus par Message
using terms from application "Messages"
on active chat message received from theBuddy for theTextChat with theText
decrypt(theText)
end active chat message received
on message sent theText with theTexte
end message sent
on message received theMessage with eventDescription
end message received
on chat room message received with eventDescription
end chat room message received
on addressed message received theMessage from theBuddy for theChat with eventDescription
end addressed message received
on received text invitation with eventDescription
end received text invitation
on received audio invitation theText from theBuddy for theChat with eventDescription
end received audio invitation
on received video invitation theText from theBuddy for theChat with eventDescription
end received video invitation
on buddy authorization requested with eventDescription
end buddy authorization requested
on addressed chat room message received with eventDescription
end addressed chat room message received
# The following are unused but need to be defined to avoid an error
on login finished with eventDescription
# say eventDescription
end login finished
on logout finished with eventDescription
# say eventDescription
end logout finished
on buddy became available with eventDescription
# say eventDescription
end buddy became available
on buddy became unavailable with eventDescription
# say eventDescription
end buddy became unavailable
on received file transfer invitation theFileTransfer with eventDescription
# say eventDescription
end received file transfer invitation
on av chat started with eventDescription
# say eventDescription
end av chat started
on av chat ended with eventDescription
# say eventDescription
end av chat ended
on completed file transfer with eventDescription
# say eventDescription
end completed file transfer
end using terms from
on decrypt(message)
if message begins with "-----BEGIN PGP MESSAGE-----" then
tell application "TextEdit"
activate
set theDocument to make new document
set text of theDocument to message
end tell
tell application "System Events"
keystroke "a" using command down
keystroke "d" using {command down, shift down}
end tell
end if
end decrypt
@MrCirdo
Copy link
Author

MrCirdo commented Dec 4, 2016

Petite configuration avant :

  • Configurer le raccourci clavier du service Open PGP: Decrypt Selection à ⇧⌘E
    cap
  • Télécharger le script
  • Aller dans les préférences de l'application Message, puis cliquer sur Ouvrir le dossier Scriptsdans Gestionnaire AppleScript.
    dossierscript
  • Ensuite copié le script dans le dossier ouvert. Et sélectionner le dans le Gestionnaire AppleScript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment