• 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: Relative path (Jolly Roger)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Relative path (Jolly Roger)


  • Subject: Re: Relative path (Jolly Roger)
  • From: Nir Soffer <email@hidden>
  • Date: Thu, 21 Dec 2000 11:29:19 +0200

I can not have the problem of a missing script, because a missing script
would not show up in the script menu of applications like Powermail or
BBEdit. These application show in the menu the script that exists in the
scripts folder.

The problem is how to make a generic script thats know the path to itself
when you run it as compiled script using these applications script menu.

thanks for the help

Nir Soffer

--
Email: email@hidden
ICQ: 98571424

>You have to tell the user where to put it, or better, get them to show where
>it is, then save location in a property (as an alias, so they can move it
>around). Then test for it, using what we learned yesterday about OS 9's
>resolution of non-existent aliases, but still be able to get the name of it
>in earlier OS's if the script has disappeared. Like this:
>
>
>property theScript : ""
>property scriptName : ""
>
>if theScript = "" then
> set theScript to choose file of type "osas" with prompt "Where is that
>script you're supposed to have?"
> set {ods, AppleScript's text item delimiters} to {AppleScript's text
>item delimiters, {":"}}
> set scriptName to last text item of (theScript as string)
> set AppleScript's text item delimiters to ods
>else
> try
> get alias (theScript as string)
> on error
> beep 2
> display dialog "You seem to have trashed the " & scriptName & "
>script." & return & return & "Bye!" buttons {"OK"} default button "OK" with
>icon 0
> set {theScript, scriptName} to {""}
> return
> end try
>
>end if
>
>tell application "Finder"
> set theFolder to container of theScript as alias
>end tell
>
>--carry on


  • Follow-Ups:
    • Re: Relative path (Jolly Roger)
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Remote machine
  • Next by Date: Re: Relative path (Jolly Roger)
  • Previous by thread: Re: Relative path (Jolly Roger)
  • Next by thread: Re: Relative path (Jolly Roger)
  • Index(es):
    • Date
    • Thread