I just started on Applescript this week, so I am still learning the ropes.
I am trying create a mail and do some basic operations on them without having the windows poping up.
I have tried and I am at a loss to explain what is happenning.
Any help welcomed!!!
Example 1:
tell application "Mail"
set myMsg to make new outgoing message with properties {subject:"subject"}
display dialog myMsg's visible as text
#Why is this windows visible? the library entry says that the default for this property is false
end tell
Example 2:
tell application "Mail"
set myMsg to make new outgoing message with properties {subject:"subject", visible:false}
display dialog myMsg's visible as text
# In this second example, the window flickers. It appears than disappears.
# how can we make it be really completely invisible?
end tell
tell application “Mail”
set myMsg to make new outgoing message at end of outgoing messages with properties {subject:“DroneScripter”, visible:false}
end tell
not sure what’s going on , works ok here, try the below DroneScripter.
sorry sent the wrong code oops
tell application “System Events” to tell process “Mail”
keystroke “n” using command down
set TheName to “DroneScripter”
set TheAddress to “DroneScripter@test.co.00”
set theSubject to "TEST MAIL: "
tell application “Mail”
activate
set newMessage to make new outgoing message with properties {subject:theSubject}
tell newMessage
make new to recipient at end of to recipients with properties {name:TheName, address:TheAddress}
make new to recipient at end of to recipients with properties {name:TheName, address:TheAddress}
set visible to false --so you cant edit the message
–set visible to true --so you cant edit the message
–send newMessage – un edit so the email will send it’s self without user interaction
end tell
end tell
end tell