Re: Finder and the time
Re: Finder and the time
- Subject: Re: Finder and the time
- From: "Christopher C. Stone" <email@hidden>
- Date: Sun, 18 Mar 2001 03:12:47 -0600
Hello Ken,
At 03/17/2001 23:48 -0500, Ken Dobson wrought:
>
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?
Yes, to answer your last question first. As for the parsing issue, myguess would be that that's the last usable piece of text the Finder can see.
>
set serial_num to (current date)
>
tell application "Finder"
>
if not (exists (folder serial_num ofdesktop)) 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
>
>
Fails entirely!
Nothing to get too excited about; you've set your serial_num to a DATE value. On my system that doesn't fail entirely but creates an untitled folder.
[Wraps marked with R23's method "==>"]
on fndRep(fStr, rStr, theText)
set AppleScript's text item delimiters to {fStr}
set theText to text items of theText
set AppleScript's text item delimiters to {rStr}
set theText to theText as string
return theText
end fndRep
set serial_num to (current date) as string
set serial_num to fndRep(":", ".", serial_num)
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
--
Best Regards,
Christopher Stone
______________________________
StoneWorks Computer Consulting
email@hidden