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

  • SEARCH
  • Home
  • 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 9010115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:22:24+00:00 2026-06-16T02:22:24+00:00

I have create one mail plugin and add Button beside the Send button of

  • 0

I have create one mail plugin and add “Button” beside the “Send” button of outgoing Mail,

enter image description here

and now i want to send outgoing Mail from my Button also and i also write applescript for that like

activate application "Mail"
tell application "System Events"
    tell application process "Mail"
        log "foo"
        tell menu bar 1
            tell menu bar item "Message"
                tell menu "Message"
                    click menu item "Send"
                end tell
            end tell
        end tell
    end tell
end tell

This script is working in Applescript editor but NOT WORKING FROM MY BUTTON CLICK

I have also execute applescript in Xcode like

NSURL* url = [NSURL fileURLWithPath:path];
NSDictionary* errors = [NSDictionary dictionary];    
NSAppleScript* appleScript = [[NSAppleScript alloc] initWithContentsOfURL:url error:&errors];
[appleScript executeAndReturnError:&errors];

And after execute the script i have getting Error:-

NSAppleScriptErrorAppName = "System Events";
NSAppleScriptErrorBriefMessage = "Can't get menu bar 1 of application process \"Mail\". Invalid index.";
NSAppleScriptErrorMessage = "System Events got an error: Can't get menu bar 1 of application process \"Mail\". Invalid index.";
NSAppleScriptErrorNumber = "-1719";
NSAppleScriptErrorRange = "NSRange: {0, 0}";

So I have tried all the thing But not get success.

So PLEASE HELP me to out this Problem

Thanks for any suggestion or help.

  • 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-16T02:22:26+00:00Added an answer on June 16, 2026 at 2:22 am

    That menu item does have a keyboard shortcut, so you can use that too. Did you try this?

    activate application "Mail"
    tell application "System Events"
        tell application process "Mail"
            keystroke "d" using {command down, shift down}
        end tell
    end tell
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a one-time need to create a file from an iOS mutable array.
I have a button in one of my classes that i create it with
I have been trying to create a HTML E-mail, which is just one image
I have to create one table using XSLT and CSS. The table should look
I have a create method in one controller and at the end of this
I have three models that are coming together to create one view model and
I have 2 customer views one for create and one for edit. I am
I have a Report. I need to create another one, similar to the one
I work with Oracle 11g. I have one table: create table test (one number(2),
I have created one user named tuser with create database rights in SQL server

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.