0

I'd like to add dynamic dates into my Alfred Workflow, but can't figure it out. This is what I've got so far:

    tell application "Mail"
    activate
    make new outgoing message with properties {subject:"some subject", content:"some content" & return & return}
    end tell

I'd like to include a dynamic date in the subject and Alfred snippets in the content, but they're not being recognized. For example:

    tell application "Mail"
    activate
    make new outgoing message with properties {subject:"{date} Call Follow Up", content:"some content" & return & return}
    end tell

Does that make sense? Any help would be much appreciated!

chris_aych
  • 729
  • 1
  • 5
  • 8

2 Answers2

1

I am not sure if I understand your problem correctly.

Are you trying to accomplish something like this?

set mySubject to ((current date) as text) & " Call Follow Up"

tell application "Mail"
    activate
    make new outgoing message with properties {subject:mySubject, content:"some content" & return & return}
end tell
psimekjr
  • 325
  • 1
  • 3
  • 10
1

Apparently, you can't access Alfred variables in the Run Script workflow object. So, you can do something like this: 1. Add a snippet object 2. Connect to it a keyword input object 3. Connect a run script object with this code:

on run argv
  set theQuery to item 1 of argv
    set theSubject to date string of (current date) & " Call Follow up"
    tell application "Mail"
    activate
    make new outgoing message with properties {subject:theSubject, content:theQuery & return & return}
end tell
end run
unlocked2412
  • 111
  • 4