Re: Finder and the time
Re: Finder and the time
- Subject: Re: Finder and the time
- From: Michelle Steiner <email@hidden>
- Date: Sun, 18 Mar 2001 00:44:23 -0800
On 3/17/01 8:48 PM, Ken Dobson <email@hidden> wrote:
>
Creates this --> folder "01 PM" of application "Finder"
>
>
I assume this to be the seconds only of the current time, as running the
>
script a few times returns folders named "01","12","23"...
As you surmised, it's because the Finder does not allow colons in file or
folder names, so it parses out everything before the last colon.
Furthermore,
set serial_num to (current date)
[...]
>
Fails entirely!
>
Is this because the Finder won't allow the ":" character in a folder or file
>
name? Why then does the time string routine parse just the second to the
>
folder name?
Because current date is not a string, but a date.
Try this:
set text item delimiters to ":"
set serial_num to time string of (current date)
set serial_elements to text items of serial_num
set text item delimiters to "."
set serial_num to serial_elements as text
set text item delimiters to ""
tell application "Finder"
if not (exists (folder serial_num of desktop)) then
set the new_folder to make new folder at desktop ,
with properties ,
{name:serial_num, label index:6}
end if
open new_folder
end tell
-->folder "12.43.58 AM" of application "Finder"
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------