Re: Referring to the local hard drive
Re: Referring to the local hard drive
- Subject: Re: Referring to the local hard drive
- From: Hans Haesler <email@hidden>
- Date: Thu, 4 Jan 2001 09:08:06 +0100
On Wed, 03 Jan 2001, JollyRoger wrote:
>
> set yourVariable to characters 1 thru -2 of (path to startup disk as text)
>
> as text
>
>
That works very well, and requires less time and steps. Good thinking! :)
... condition is that AppleScript's text item delimiters are {""}
When they are different, e.g. {":"}, then:
set diskName to characters 1 thru -2 of (path to startup disk as text) as text
-->"M:a:c:i:n:t:o:s:h: :H:D"
set diskName to text 1 thru -2 of (path to startup disk as text)
-->"Macintosh HD"
Using "text" instead of "characters" is shorter, faster and... immune
to text item delimiters which have not been restored to {""}.
Regards,
Hans
---
Hans Haesler | email@hidden