|
|
#1 |
|
Prospect
Join Date: Oct 2009
Posts: 1
|
I am trying to send an email back to the person that sent one to me telling the itunes track & artist that is currently playing.
I've got it to send one to a certain email adress Which is Code:
tell application "iTunes"
set trk_arts to the artist of the current track
set trk_name to the name of the current track
set playlisto to the name of the current playlist
end tell
tell application "Mail"
delay 3
set theMessage to make new outgoing message with properties {visible:true, subject:"Answer:", content:"The Current Track is \"" & trk_name & "\" by " & trk_arts & ". iTunes is currently in the playlist \"" & playlisto & "\""}
tell theMessage
make new to recipient with properties {address:"
Code:
on perform_mail_action(info)
tell application "iTunes"
set trk_arts to the artist of the current track
set trk_name to the name of the current track
set playlisto to the name of the current playlist
end tell
tell application "Mail"
set theMessages to |SelectedMessages| of info
repeat with thisMessage in theMessages
set AppleScript's text item delimiters to {""}
set thisSender to sender of theMessages
set theNewMessage to make new outgoing message with properties {visible:true, subject:"Answer:", content:"The Current Track is \"" & trk_name & "\" by " & trk_arts & ". iTunes is currently in the playlist \"" & playlisto & "\""}
tell theNewMessage
make new to recipient with properties {address:thisSender}
end tell
send theNewMessage
end repeat
end tell
end perform_mail_action
|
|
|
|
|
|
#2 |
|
Triple-A Player
Join Date: Nov 2005
Location: Eastern US
Posts: 124
|
This is essentially a "Me too" message, but I am looking to do something similar.
Are you currently able to send an email just fine if you hard code the send-to address, but can't find a way to grab the original sender's email? If so, that is where I am as well. If not, I can help you get to that point. Just let me know. |
|
|
|
|
|
#3 |
|
Hall of Famer
Join Date: Apr 2007
Posts: 3,342
|
if you're trying to get mail to do this automatically from a rule, you need to put it is as 'on perform mail actions' block, like so:
Code:
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "iTunes"
set trk_arts to the artist of the current track
set trk_name to the name of the current track
set playlisto to the name of the current playlist
end tell
tell application "Mail"
repeat with thisMessage in theMessages
set AppleScript's text item delimiters to {""}
set thisSender to sender of theMessages
set theNewMessage to reply thisMessage with opening window
tell theNewMessage
set content to "The Current Track is \"" & trk_name & "\" by " & trk_arts & ". iTunes is currently in the playlist \"" & playlisto & "\""
end tell
send theNewMessage
end repeat
end tell
end perform mail action with messages
end using terms from
Code:
tell theNewMessage
make new to recipient at end of to recipients with properties {address:thisSender}
end tell
__________________
Philosophy is a battle against the bewitchment of our intelligence by means of language. -LW- |
|
|
|
![]() |
| Tags |
| applescript, auto-reply, itunes, mail, programming |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|