Re: [newbie questions]
Re: [newbie questions]
- Subject: Re: [newbie questions]
- From: "Marc K. Myers" <email@hidden>
- Date: Tue, 23 Jan 2001 18:30:28 -0500
- Organization: [very little]
Steve Ivy wrote:
>
Date: Tue, 23 Jan 2001 14:25:44 -0500
>
Subject: [newbie questions]
>
From: Steve Ivy <email@hidden>
>
To: <email@hidden>
>
>
-- relative paths in applescript
>
>
ok, I've come from the land of Unix scripting to Applescript, and I'm
>
wondering how one does relative path on the Mac?
>
>
I have some scripts I'm packaging up in, well, a Mac OS 9 package, and I
>
want my scripts to all use relative paths to load resources and other
>
scripts. How do I do this?
>
>
-- save and close frustration
>
>
I have a script that opens and modifes a document in BrainForest, but for
>
the life of me I can't get the damn thing (the brainforest doc?) to
>
recognize the save or close commands. I get a "[whatever object] does not
>
understand the close message". This may be related to the fact that I've ha d
>
mixed results in giving the app a file to open. I have best results using an
>
alias (set foo to alias "path::to:file" .. open {foo}) but it feels kludgy.
>
what might I be doing wrong?
>
>
Thanks in advance for your help and patience!
If you want to get relative to the script's application file's folder
you can say:
tell application "Finder"
set myFldr to container of (path to me)
end tell
You can coerce myFldr to text and use it to build file paths.
The "path to" scripting addition also provides direct access to most of
the system-defined folders, i.e. "set mySystem to (path to system
folder)" returns an alias reference to the System folder.
On your second question I suspect you're telling the document to close
instead of telling the application to close the document. Documents
don't respond to "open" and "close" commands - applications do.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[1/23/01 6:27:29 PM]