• 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: path to question?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: path to question?


  • Subject: Re: path to question?
  • From: Andy Wylie <email@hidden>
  • Date: Tue, 17 Jul 2001 11:31:14 +1200

on 17/7/01 9:55 am, Admin nimlok.com at email@hidden wrote:

> Thanks Steve for your reply.
>
> Actually what I'm trying to do is get the path to the folder
> that an application is in?
>
> set filepath to path to creator "CDP3" as string
>
> returns
>
> file "HD I:Desktop Folder:VectorWorks:VectorWorks"
>
> I want
>
> file"HD I:Desktop Folder:VectorWorks:"
>
> I've tried delimiting the string but get errors.
> applescript acts like filepath is not a string,
> not sure why?
>

You need to use parenthesis to isolate the equation...
----------------------
set filepath to (path to creator "CDP3") as string
--"HD I:Desktop Folder:VectorWorks:VectorWorks"
----------------------

The desired class and an ampersand before will also coerce it...
----------------------
set filepath to "" & (path to creator "CDP3")
--"HD I:Desktop Folder:VectorWorks:VectorWorks"
----------------------

getting the path to container with TIDs...
----------------------
set AppleScript's text item delimiters to {":"}
set filepath to "" & text items 1 thru -2 of filepath & ":"
set AppleScript's text item delimiters to ""
-- "HD I:Desktop Folder:VectorWorks:"
----------------------

or Standard additions 'offset'...
----------------------
(filepath)'s text 1 thru -(offset of ":" in ("" & (filepath)'s items's
reverse))
-- "HD I:Desktop Folder:VectorWorks:"
----------------------

if anyone is wondering 'path to creator' is from Akua Sweets OSAX, Smile's
Satimage OSAX also has this function in 'path to application'

__________________________HTH Andy


  • Follow-Ups:
    • Re: path to question?
      • From: Admin <email@hidden>
References: 
 >Re: path to question? (From: "Admin nimlok.com" <email@hidden>)

  • Prev by Date: Re: path to question?
  • Next by Date: Re: path to question?
  • Previous by thread: Re: path to question?
  • Next by thread: Re: path to question?
  • Index(es):
    • Date
    • Thread