Retired Document
Important: This document may not represent best practices for current development. Links to downloads and other resources may no longer be valid.
How do I access files contained in my AppleScript Studio application's main bundle?
Q: How do I access files contained in my AppleScript Studio application's main bundle?
A: How do I access files contained in my AppleScript Studio application's main bundle?
If you have files in your AppleScript Studio application's bundle (that is, in your Resources folder under Groups & Files (see Figure 1), you can access them by using "resource path of main bundle
" plus the pathname hierarchy to the file. See Listing 1 for an example.

Listing 1 Using 'resource path of main bundle'
set myFile to (resource path of main bundle) & "/path/to/your/file.txt" |
When you run this, myfile
would contain a path similar to "/Users/username/AppleScript Studio.app/Contents/Resources/path/to/your/file.txt
". (This path would likely include ".../build/Debug
" when testing within Xcode.)
For more information on bundles in AppleScript Studio, see the Application Suite > Terminology > bundle section of "AppleScript Studio Terminology Reference"; you can find it in the ADC Reference Library at Reference > AppleScript > Tools.
Document Revision History
Date | Notes |
---|---|
2007-02-05 | Clarified pathname hierarchy references; added pointer to reference guide. |
2006-10-09 | New document that explains how to access files stored within an AppleScript Studio application. |
Copyright © 2007 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2007-02-05