Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

getting path of parent directory

 
   Macintosh computer (Home) -> Apple Scripts RSS
Next:  mail.app: mailboxes of a mac account  
Author Message
John Wain

External


Since: Sep 07, 2003
Posts: 5



(Msg. 1) Posted: Tue Sep 09, 2003 11:49 pm
Post subject: getting path of parent directory
Archived from groups: alt>comp>lang>applescript (more info?)

Does anyone have a very fast formula to obtain the path of the
containing directory from a reference to a file or sub dir?

e.g. in a folder action script:
on adding folder items to this_folder
set the_parent to the container of this_folder

--
John

 >> Stay informed about: getting path of parent directory 
Back to top
Login to vote
Patrick Stadelmann

External


Since: Nov 12, 2003
Posts: 361



(Msg. 2) Posted: Tue Sep 09, 2003 11:49 pm
Post subject: Re: getting path of parent directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <1g11dah.wiklk51x72gjmN%john@disneyland.com>,
john RemoveThis @disneyland.com (John Wain) wrote:

 > Does anyone have a very fast formula to obtain the path of the
 > containing directory from a reference to a file or sub dir?

tell application "Finder"
get container of myFolder
end

Patrick
--
Patrick Stadelmann <Patrick.Stadelmann RemoveThis @unine.ch><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: getting path of parent directory 
Back to top
Login to vote
Steve10

External


Since: Jun 30, 2003
Posts: 12



(Msg. 3) Posted: Tue Sep 09, 2003 11:49 pm
Post subject: Re: getting path of parent directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 9 Sep 2003 6:49:32 -0400, John Wain wrote
(in message <1g11dah.wiklk51x72gjmN%john@disneyland.com>):

 > Does anyone have a very fast formula to obtain the path of the
 > containing directory from a reference to a file or sub dir?
 >
 > e.g. in a folder action script:
 > on adding folder items to this_folder
 > set the_parent to the container of this_folder
 >
 >

Use text item delimiters to convert to a list
Drop the last item of the list
Use tid's to change back to the folder path<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: getting path of parent directory 
Back to top
Login to vote
Patrick Stadelmann

External


Since: Nov 12, 2003
Posts: 361



(Msg. 4) Posted: Tue Sep 09, 2003 11:49 pm
Post subject: Re: getting path of parent directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <0001HW.BB835E150026009209E2D720.DeleteThis@text.giganews.com>,
Steve <nospam.DeleteThis@nospam.com> wrote:

 > Use text item delimiters to convert to a list
 > Drop the last item of the list
 > Use tid's to change back to the folder path

Using pathname is not recommanded in Mac OS as there's no guarantee that
a given pathname is unique.

Patrick
--
Patrick Stadelmann <Patrick.Stadelmann.DeleteThis@unine.ch><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: getting path of parent directory 
Back to top
Login to vote
John Wain

External


Since: Sep 07, 2003
Posts: 5



(Msg. 5) Posted: Thu Sep 11, 2003 1:19 pm
Post subject: Re: getting path of parent directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Patrick Stadelmann <Patrick.Stadelmann DeleteThis @unine.ch> wrote:

 > tell application "Finder"
 > get container of myFolder
 > end

Fine. Thank you. Just what I wanted.

Regards.

--
John<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: getting path of parent directory 
Back to top
Login to vote
Display posts from previous:   
   Macintosh computer (Home) -> Apple Scripts All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]