• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Finder and the time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Finder and the time (From: Ken Dobson <email@hidden>)

  • Prev by Date: Re: define my own finder keyboard shortcuts?
  • Next by Date: How to use delimiters in Standard Additions file read/write commands?
  • Previous by thread: Finder and the time
  • Next by thread: Re: Finder and the time
  • Index(es):
    • Date
    • Thread