Re: path to question?
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