• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [newbie questions]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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]


  • Prev by Date: Re: newbie: how to get result of "cancel"
  • Next by Date: Re: newbie: how to get result of "cancel"
  • Previous by thread: Relative paths (was Re: [newbie questions])
  • Next by thread: scripting copy from one filemaker database to another
  • Index(es):
    • Date
    • Thread