Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8752279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:12:10+00:00 2026-06-13T13:12:10+00:00

I am trying to create a new email using the cocoa scripting bridge,but can

  • 0

I am trying to create a new email using the cocoa scripting bridge,but can not seem to get it to work.I have so far:

MailApplication *mail = [SBApplication applicationWithBundleIdentifier:@"com.apple.Mail"];
MailOutgoingMessage *emailMessage = [[[[mail classForScriptingClass:@"outgoing message"]     alloc] initWithProperties:[NSDictionary dictionaryWithObjectsAndKeys: [saveFileName substringToIndex:[saveFileName length]-4], @"subject", @"something about app.", @"content", nil]] autorelease];
// add the object to the mail app 
[[mail outgoingMessages] addObject: emailMessage];
emailMessage.visible = YES;

if ( [FileFullName length] > 0 ) {

    MailAttachment *theAttachment = 
    [[[mail classForScriptingClass:@"attachment"] alloc]
     initWithProperties:[NSDictionary dictionaryWithObjectsAndKeys:
                         FileFullName, @"fileName",nil]];
    // add it to the list of attachments 
    [[emailMessage.content attachments] addObject: theAttachment];
    [theAttachment release];
}

When I try and set the visible property,I got the error message:

-[SBProxyByClass setVisible:]: object has not been added to a container yet; selector not recognized [self = 0x7fd4fae3cc90]

This issue appeared when I added the sandbox for app.
Can anyone point the correct direction?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:12:11+00:00Added an answer on June 13, 2026 at 1:12 pm

    If your code can work before you enable the sandbox, then you should do this first before you send the mail. Add the follow code to your Entitlements.plist.

        <key>com.apple.security.temporary-exception.apple-events</key>
        <array>
        <string>com.apple.mail</string>
        </array>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to create a new Dedicated Cache Role in Windows Azure but get the
I am now trying to create new database manager under Fragment class. But unfortunately,
I'm trying to create a new project using tomcat 7.0.27 + JSF 2.1.7 +
I am trying to create a new web application using PowerShell. I keep getting
I'm trying to create a new record of Person thru my App. I have
I am trying to create a webapp on a node/couchdb/windows stack but get terribly
So I have been struggling for days now, trying to simply create a new
I'm trying to create an email template and replace words in the document using
I'm new to Rails and I'm trying to create an app using devise for
I'm trying to create a contact form using phpMailer and I get in firebug

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.