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 7738715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:20:20+00:00 2026-06-01T08:20:20+00:00

I will begin by saying that I’m a complete newbie as far as AppleScript

  • 0

I will begin by saying that I’m a complete newbie as far as AppleScript goes. So here you are…

This is what I’ve done so far :

  • Studied the apple reference for SimpleScripting
  • Implemented an IDENTICAL .sdef file
  • Set a new property myname
  • Set principal class (in info.plist) to ppApplication (my main class inheriting from NSApplication)
  • Set up the accessor to the myname property

My sdef file :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
<dictionary xmlns:xi="http://www.w3.org/2003/XInclude">
    <xi:include href="file:///System/Library/ScriptingDefinitions/CocoaStandard.sdef" xpointer="xpointer(/dictionary/suite)"/>
    <suite name="MyApplication Suite" code="PpRm" description="MyApplication Suite">
        <class name="application" code="capp" description="MyApplication&apos;s top-level scripting object." inherits="application">
            <cocoa class="ppApplication"/>
            <property name="myname" code="PEnm" description="The name of the application" type="text" access="r">
                <cocoa key="myname"/>
            </property>
        </class>
    </suite>
</dictionary>

My ppApplication class :

#import <Foundation/Foundation.h>

#import "ppCore.h"

@interface ppApplication : NSApplication {
    ppCore* core;
}

@property (assign) ppCore* core;

@property (readonly) NSString* myname;

@end

#import "ppApplication.h"

@implementation ppApplication

@synthesize core;

- (void)awakeFromNib
{
    [self setCore:[[ppCore alloc] init]];
}

/*******************************************************
 *
 * APPLESCRIPT SUPPORT
 *
 *******************************************************/

- (NSString*)myname
{
    return @"DONE";
}

@end

Now, here’s the issue :

When I’m trying to run the following script (in AppleScript Editor)

tell application "myApplication"
     myname
end tell

I’m getting a the variable myname is not defined error.

However :

If I go back to Xcode, Build Settings and change the Product Name to – let’s say – myApplicationX and recompile, then the above code (changing it to tell application "myApplicationX") DOES WORK.

So, what am I doing wrong? Is it possible that the AppleScript Editor doesn’t “talk” to my active compilation of the application, but to a previous one? How could I deal with this WITHOUT changing my Product Name?

  • 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-01T08:20:21+00:00Added an answer on June 1, 2026 at 8:20 am

    There was NO issue with the above code.

    Simply restarting AppleScript Editor (after making any serious changes to the application) does the trick.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let me begin by saying this; I know that similar questions exist, but they
I will begin this question by admitting I am very new to MVC. The
Typically you will find STL code like this: for (SomeClass::SomeContainer::iterator Iter = m_SomeMemberContainerVar.begin(); Iter
I am in the process of designing an app that will begin on an
I will preface this question by saying, I do not think it is solvable.
I will begin by briefing as to what this actually should do... Fetch the
I'm developing a website which to begin with will have three clear sub sites:
I need to begin working with milliseconds in .Net 3.0. The data will be
I was reading this html generated, (may expire , Here is the original ps
Google shows a couple of hits for this issue, but never a solution that

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.