Solved

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

Posted on 2004-10-01
8
409 Views
Last Modified: 2013-12-18
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
0
Comment
Question by:intouchsystems
8 Comments
 
LVL 15

Expert Comment

by:Bozzie4
ID: 12201431
AppleScript ????  Cool :-)

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

cheers,

Tom
0
 

Author Comment

by:intouchsystems
ID: 12201470
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
0
 
LVL 14

Accepted Solution

by:
p_partha earned 250 total points
ID: 12201488
0
 
LVL 31

Assisted Solution

by:qwaletee
qwaletee earned 250 total points
ID: 12229253
    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

change to

     replaceitemvalue myDoc itemname "Subject" newvalue "Is there an attachment?"
     set myBody to make new richtextitem with data {myDoc,"Body"}
     appendtext myBody newvalue newvalue "Yes :-), No :-("
     embedobject myBody with data { 1454 , "" , attach1 }
     replaceitemvalue myDoc itemname "CopyTo" newvalue CCAddress
     send myDoc without attachform

Now, I don't know AppleScript, but based on the syntax you used, I attempted to piece it together.

The call
    set myDoc to make new document with data {myDB}
Is equivalent to LotusScript
    set myDoc = New NotesDocument ( myDB )
I thus reversed
    Set myBody = New NotesRichTextItem ( myDoc , "Body" )
Into AppleScript
    set myBody to make new richtextitem with data {mydoc,"Body"}

Hopefully, I similarly got
    replaceitemvalue myDoc itemname "SendTo" newvalue ToAddress
As being LotusScript
    myDoc.replaceItemValue "SendTo" , ToAddress
Although the newvalue bit threw me, since Lotus help and mappings just call it "value."

The EMbedObect might notbe correct.  I assumed that With Data works across all calls, not just instalntiation, so that you don't have to name all the parameters.  If not, the following might work:
     embedobject myBody type 1454 class "" source attach1
Or
     embedobject myBody type 1454 class "" source attach1 name ""
Or
     embedobject myBody type 1454 class "" source attach1 name NULL
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 12710375
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.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now