[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2004-10-01
8
Medium Priority
?
461 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1000 total points
ID: 12201488
0
 
LVL 31

Assisted Solution

by:qwaletee
qwaletee earned 1000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

650 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