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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:16:01+00:00 2026-05-29T12:16:01+00:00

Try this: Make a new XCode4 Applescript project. In the delegate, paste this code:

  • 0

Try this:

  1. Make a new XCode4 Applescript project. In the delegate, paste this code:

    on doIt_(sender)
        set goodHFSLoc to (path to desktop folder)
        set test1 to (POSIX path of goodHFSLoc)
        log "test1:"&test1
        set theJSPath to "/Users/dave/Desktop/MakeTSLabels.js"
        set jsHFSFile to (POSIX file theJSPath)
        set test2 to (POSIX path of jsHFSFile)
    end doIt_
    
  2. Hook this method up to a button in the UI window.

  3. Run the program
  4. Click the button, and you should get this error:

    Can’t get POSIX path of class "NSObject".
    
  5. Put the same code (minus the “on” and “end” lines) into AppleScript editor, and it runs fine.

Apparently, “POSIX file” in ApplescriptObjC doesn’t make a file object as the language specification requires. Instead it makes an NSObject.

I need to have an applescript file specifier to provide to Adobe Illustrator’s do javascript command, and I need to use NSBundle’s functions to get the javascript file, which is packaged in my application bundle.

Am I doing something wrong?

  • 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-29T12:16:04+00:00Added an answer on May 29, 2026 at 12:16 pm

    You will see the same behavior in a Finder or System Events tell statement. The solution is the same for ASObjC – you need to use it as a coercion:

    set jsHFSFile to (theJSPath as POSIX file)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm fairly new to C# but I will try to make this quick! ;)
I'm new for rails and ruby. I try to make a simple project and
I try to make this query with doctrine 1.2: $q->where('date > ?', new Doctrine_Expression('DATE_SUB(CURDATE()
I'll try to make this as straight forward as possible. Currently our team has
I will try to make this as clear as I can, but if you
Ok, I'm going to try to make this more clear because my last question
I am starting this question to try and make a central point developers can
please try this link for getting my code. its working in all browsers not
When I try this code: a, b, c = (1, 2, 3) def test():
OKay, I will try to make this make sense lol. Basically I have 4

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.