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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:55:14+00:00 2026-05-15T08:55:14+00:00

Ok, so I’ve got an application, and I want to make it scriptable. I

  • 0

Ok, so I’ve got an application, and I want to make it scriptable. I set up the plist, I set up the sdef file.

So far I have only one apple Event command: gotoPage. it takes an integer. and returns a boolean.

The relevant XML is:

    <command name="gotoPage" code="dcvwgoto" description="Goto a specified page">
        <cocoa class="AEGoto"/>
        <direct-parameter description="Page Number" type="integer"/>
        <result description="True if the page exists, False othrewise" type="boolean"/>
    </command>

I have an Objective-C class AEGoto.h:

@interface AEGoto :NSScriptCommand {
}
- (id)performDefaultImplementation;


- (id)performDefaultImplementation
{
    int page = [[self directParameter] intValue];
    Boolean retval = [gController setPage: page];
    return retval? @"YES" : @"NO";
}

setPage: (int) is correct, and works fine.

When I call this, my program seems to work correctly. But then I get the error:

error “DocView got an error: 4 doesn’t understand the gotoPage message.” number -1708 from 4

I also get, in my DocView output:

Error while returning the result of a script command: the result object… YES …could not be converted to an Apple event descriptor of type ‘boolean’. This instance of the class ‘NSCFString’ doesn’t respond to -scriptingBooleanDescriptor messages.

However, if I return just the straight Boolean, I get:

Single stepping until exit from function -[NSScriptingAppleEventHandler handleCommandEvent:withReplyEvent:],
which has no line number information.
Program received signal: “EXC_BAD_ACCESS”.

so, I guess I’ve got 2 questions: 1) Why does it think it wants to tell 3 to goto a page? and 2) what is the correct way to return a Boolean from the applescript?

thanks.

  • 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-05-15T08:55:15+00:00Added an answer on May 15, 2026 at 8:55 am

    return [NSNumber numberWithBool:retval];

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

Sidebar

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.