tell application "Mail"
set theLink to "message:://%3C" & (message id of item 1 of (get selection)) & "%3E"
end tell
do shell script "echo '<a href=\"" & theLink & "\">Voir message dans Mail</a>' | textutil -format html -convert rtf -stdin -stdout | pbcopy -Prefer rtf"
Oui, la fin de l'identifiant sera différente selon le message (le FAI de l'envoyeur )'ai bien trouvé l'ID du message mais il ne se finit pas par "JavaMail.email.apple.com>" comme dans l'exemple mais par:
JavaMail.www@wwinf1u15>
ou bien
@mailjet.com>
OneNote le voit comme du texte, il faut faire "Insérer un lien" --> (commande + K).Mon lien n'est donc pas clickable comme dans l'exemple. Comment faire ?
Pour le script : il y a plusieurs possibilités , en voici uneDe plus vous parlez de l'utilisation d'un script AppleScript. De quelle manière l'utiliser et l’exécuter ?
Cordialement
on run
tell application "Mail"
set theLink to "message:://%3C" & (message id of item 1 of (get selection)) & "%3E"
end tell
do shell script "echo '<a href=\"" & theLink & "\">Voir message dans Mail</a>' | textutil -format html -convert rtf -stdin -stdout | pbcopy -Prefer rtf"
end run
Bonjour, est ce que on peut avec l'ID d'un message sur Outlook 365 ?
tell application "Microsoft Outlook"
set theLink to "outlook://" & (id of item 1 of (get selection))
end tell
do shell script "echo '<a href=\"" & theLink & "\">Voir message dans Outlook</a>' | textutil -format html -convert rtf -stdin -stdout | pbcopy -Prefer rtf"
on open location outlookUrl
set theId to text 11 thru -1 of outlookUrl
tell application "Microsoft Outlook"
activate
open message id theId
end tell
end open location
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleAllowMixedLocalizations</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>applet</string>
<key>CFBundleIconFile</key>
<string>applet</string>
<key>CFBundleIdentifier</key>
<string>com.apple.ScriptEditor.id.OpenOutlookLink</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>OpenOutlookLink</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>aplt</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>OutlookURLHandler</string>
<key>CFBundleURLSchemes</key>
<array>
<string>outlook</string>
</array>
</dict>
</array>
<key>LSMinimumSystemVersionByArchitecture</key>
<dict>
<key>x86_64</key>
<string>10.6</string>
</dict>
<key>LSRequiresCarbon</key>
<true/>
<key>WindowState</key>
<dict>
<key>bundleDividerCollapsed</key>
<true/>
<key>bundlePositionOfDivider</key>
<real>0.0</real>
<key>dividerCollapsed</key>
<true/>
<key>eventLogLevel</key>
<integer>2</integer>
<key>name</key>
<string>ScriptWindowState</string>
<key>positionOfDivider</key>
<real>421</real>
<key>savedFrame</key>
<string>20 767 354 347 0 0 2048 1129 </string>
<key>selectedTab</key>
<string>description</string>
</dict>
</dict>
</plist>
Dans les en-têtes du message (quel que soit le logiciel, la structuration du fichier source est la même), c'est la balise Message-ID:comment je trouve l'ID de mon message Outlook ?
Ok j'ai trouvé l'ID de mon message mais je n'ai pas bien saisi ta manœuvre. A quel moment je met l'adresse ID de mon message pour faire un lien direct ?Dans les en-têtes du message (quel que soit le logiciel, la structuration du fichier source est la même), c'est la balise Message-ID:
Il suffit de sélectionné un message dans Outlook, et d'exécuter le premier script pour obtenir un lien dans le presse-papiers, après tu colles ce lien où vous voulez.1/ je trouve l'ID de mon message Outlook ?
2/ comment je le lie à ta procédure ?
C'est le deuxième script, il suffit de l'enregistrer dans le format "Application" avec ce nom "OpenOutlookLink" dans un dossier de votre choix.3/ comment trouver OpenOutlookLink.app ?
Bonjour,
Il suffit de sélectionné un message dans Outlook, et d'exécuter le premier script pour obtenir un lien dans le presse-papiers, après tu colles ce lien où vous voulez.
C'est le deuxième script, il suffit de l'enregistrer dans le format "Application" avec ce nom "OpenOutlookLink" dans un dossier de votre choix.
Non, c'est un AppleScript, pas un script shell.Pour exécuter le script il faut lancer le terminal ?
Bonjour
Désolé, mais je ne parviens pas à réaliser cette étape. Quand tu dis "Enregistre-le comme Application au lieu de Script" c'est dans automator ? Comment faire ?
super ! merci beaucoup, je tenteBonjour,
L'application de base pour les scripts AppleScript est "Éditeur de script" (sert aussi pour des scripts JavaScript (JXA)), il est dans le dossier "/Applications/Utilitaires/".
Donc, ouvre l'application "Éditeur de script":
Colle un script dans la fenêtre.
Compile le script avec les touches commande + k
Enregistre le document avec les touches commande + s
Lorsque la fenêtre d'enregistrement s'affichera, il suffit de sélectionner "Application" comme format de fichier (c'est dans le menu du bouton en bas de la fenêtre) .
par contre impossible de coller le lien généré dans la calendrier du Mac. Est ce normal ?
use framework "Foundation"
use scripting additions
tell application "Microsoft Outlook"
set theLink to "outlook://" & (id of item 1 of (get selection))
end tell
set myRTF to do shell script "echo '<a href=\"" & theLink & "\">Voir message dans Outlook</a>' | textutil -format html -convert rtf -stdin -stdout"
set pBoard to current application's NSPasteboard's generalPasteboard()
pBoard's clearContents() -- vide
pBoard's setString:myRTF forType:"public.rtf" -- un RTF qui contient un lien
pBoard's setString:theLink forType:"public.utf8-plain-text" -- seulement l'adresse du lien