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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:39:04+00:00 2026-05-27T23:39:04+00:00

The line: set appPath to POSIX path of alias :Applications:iTunes.app works fine in AppleScript

  • 0

The line:

set appPath to POSIX path of alias ":Applications:iTunes.app"

works fine in AppleScript Editor and returns: "/Applications/iTunes.app/"

But when I run the following command in the terminal:

osascript -e 'set appPath to POSIX path of alias ":Applications:iTunes.app"'

I get: 15:61: syntax error: File alias :Applications:iTunes.app wasn't found. (-43)

Why?

  • 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-27T23:39:05+00:00Added an answer on May 27, 2026 at 11:39 pm

    I’m not sure where you came up with “:Applications:iTunes.app”… but that is not a valid path. Colon delimited paths that are used in applescript always start with the name of your hard drive. So it should be something like “Macintosh HD:Applications:iTunes.app:”. I can’t tell you why it works in applescript editor (you’re just lucky I guess ;)), but I’m sure if you try it the correct way it will work.

    Notice that the path I used ends with a colon eg. “Macintosh HD:Applications:iTunes.app:”. In general applications are package files which means they’re really folders… and folders end in a colon.

    Note that when you coerce a string like “:Applications:iTunes.app” to an alias (as you’re doing by putting the word alias first), because it’s an alias it means that the file at the path must exist. That’s the definition of an alias-type path. The file must exist. And because the file can’t possibly exist because of your incorrect path then you get the error.

    Another note: the “posix path” coercion will work on a string so you really don’t need the word “alias” at all… although you may get unexpected results because as I mentioned the string portion of your path is not correct (sorry to keep saying that!).

    Final note: here’s one way you can find the correct applescript-style path to a file. Just run this and look at the result in AppleScript Editor. This will work for folders too if you change “file” to “folder” in the code. Try it out on an application and you will see that if the application is a package file then it will end in a colon.

    (choose file) as text
    

    Anyway, I hope that teaches you something as you go forward with your applescripting.

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

Sidebar

Related Questions

Something equivalent to this command line: set PATH=%PATH%;C:\Something\bin To run my application, some thing
I have added a event to my mySQL db and it works fine, but
I have a line set cpoptions+=$ in my .vimrc file. However according to verbose
I have scrip contain command line: set dir=%1 cd %dir% test.bat echo successful When
When I want to add the line SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED right
I have the below command line arguments set for the program. argument proc is
I have unsorted set of line segments without any binding to each other. Each
I am trying to find the linear trend line for a set of data.
I set the font-family in the jquery.jwysiwyg.js (line-# 497 where < body > is
Is there a set of command-line options that will convince gcc to produce a

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.