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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:20:56+00:00 2026-05-23T14:20:56+00:00

This is my first applescript. I thought I’d do something simple like navigating to

  • 0

This is my first applescript. I thought I’d do something simple like navigating to a folder using a path and listing the subfolders…Unfortunately, I can’t figure it out 🙂

Here is what I’ve tried so far:

The first try:

tell application "Finder"
    set the_folder to POSIX path of "Users:MyName:Doc"
    log the_folder
    set folder_list to every item of folder the_folder
    log folder_list 
end tell

This produces an error:
“Finder got an error: Can’t get folder “/Users/MyName/Doc”.

Could someone please:
1. Explain to me what I’m doing wrong.
2. Provide an example that works.

Thanks in advance.

btw the folder does exist on my machine…

  • 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-23T14:20:56+00:00Added an answer on May 23, 2026 at 2:20 pm

    UPDATE: Oops! It appears that I have given you the wrong information so I will give you the correct information.

    The command POSIX path of requires a complete alias reference. By that I mean supplying the full file reference (i.e. <your_disk_name>:Users:<your_user_name>:somefolder:). Make sure that if you’re referring to a folder that you end the reference with a colon (i.e. Macintosh HD:Users:). An improved version would look like this:

    tell application "Finder"
      set the_folder to (POSIX path of ("<your_disk_name>:Users:<your_user_name>:Doc:") as alias) as alias
      set folder_list to every item of the_folder
    end tell
    

    OPTIONAL

    To coerce a POSIX path (i.e. /Users/<your_user_name>/somefolder) back into an alias, two conversions are needed.

    Conversion 1: The first step is to convert the reference into a file reference. To do this, place the words as POSIX file after the reference, like so:

    "/Users/<your_user_name>/somefolder" as POSIX file
    

    This code procudes a file reference in this form: file "<your_disk_name>:Users:<your_user_name>:somefolder:"

    Conversion 2: Add a second coercion, as alias, to the end of the reference…

    "/Users/<your_user_name>/somefolder" as POSIX file as alias
    

    This code produces an actual alias reference: alias "<your_disk_name>:Users:<your_user_name>:somefolder:

    If you have any questions, just ask. 🙂

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

Sidebar

Related Questions

I am using jQuery UI Autocomplete with ASP.NET like this : First I am
I have css declaration like this #first, #second, #third { font-size:1em; background: url('path/to/image') no-repeat;
Using Dozer to map two objects, I have: /** /* This first class uses
#include <iostream> using namespace std; // This first class contains a vector and a
I have a JSON data like this: { hello: { first:firstvalue, second:secondvalue }, hello2:
I have string like this first#second, and I wonder how to get second part
I'm needing to program something in Applescript which I've never used, but this is
I have a MySQL table which contains comma-separated values like this: first row=(3,56,78,12) second
I'm new to Applescript, but I followed this handy tutorial, the first Google result
I have a css rule like this in my css file: .Island_VerticalMenu:first-child { width:

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.