Link to home
Start Free TrialLog in
Avatar of intouchsystems
intouchsystemsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How do I add an attachment to a Notes Memo using Applescript?

How do I add an attachment to a Notes Memo using Applescript?
I have an applescript that automatically creates and sends an email but I really need to auto add an attachment.
Mac OSX
Lotus Notes Client 6.5.1
Avatar of Bozzie4
Bozzie4
Flag of Belgium image

AppleScript ????  Cool :-)

Show us the script you have now, then we may be able to help

cheers,

Tom
Avatar of intouchsystems

ASKER

tell application "Finder"
      activate
      display dialog "Choose a file to attach"
      set somefile to choose file with prompt "Choose a file to attach…"
      set target2 to name of somefile
      set path1 to POSIX path of somefile
end tell
set attach1 to target2
property ToAddress : "systems@intouchplc.com"
property CCAddress : "systems@intouchplc.com"

tell application "Notes"
      set myDB to make new database with data {"", ""}
      try
            openmail myDB
      end try
      
      set myDoc to make new document with data {myDB}
      replaceitemvalue myDoc itemname "SendTo" newvalue ToAddress
      replaceitemvalue myDoc itemname "Subject" newvalue "Is there an attachment?"
      replaceitemvalue myDoc itemname "Body" newvalue "Yes :-), No :-("
      replaceitemvalue myDoc itemname "CopyTo" newvalue CCAddress
      send myDoc without attachform
end tell
ASKER CERTIFIED SOLUTION
Avatar of p_partha
p_partha

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of qwaletee
qwaletee

I don't know that I actaully SOLVED the problem, but I'm pretty sure there was enough info there to get the problem solved, or to take the next round of comments deeper toward a complete soultion.

Partha similarly pointed at a long script that contained some similar functions.