Replace : with _ in a time stamped foler name

Hi,
I am totally new at scripting. I want to create a hot folder which creates a new folder within the folder (which is hot) that has a date stamp of “Aug 23 16:42:21” only the folder needs to be named “Aug_23_16_42_21”. Any ideas? I really am new, and I have been having trouble with this problem. HELP!:o

What is causing a folder-named-after-a-date-stamp to be created in the first folder? Also, what do you mean by the date-stamped-folder being “hot”. What is it supposed to do?

Hi gbrauck,

If you want to change “Aug 23 16:42:21” into “Aug_23_16_42_21”. Try:

set x to "Aug 23 16:42:21"
set AppleScript's text item delimiters to {"_"}
set y to (words of x) as text
set AppleScript's text item delimiters to {""}
return y

John M

Sorry, as I said I am new.
I want to drop images onto a folder, have the sript create a folder using:

do shell script “date | awk ‘{ print $2, $3, $4 }’” as string

the images which were dropped would then be (archived) using the .zip shell command,
and then upload to FTP

I was reading “Droplet for changing file name”, by Cindy, and sitcom solved my problem. Are you still out there sitcom?

At a guess, gbrauck, I imagine you might be looking for something like this:

on m_d_h_m_s()
	set tid to text item delimiters
	set text item delimiters to "_"
	tell (current date) to set d to (its month as string)'s text 1 thru 3 & ({""} & day & (time string)'s words)
	set text item delimiters to tid
	d
end m_d_h_m_s

on adding folder items to f after receiving l
	tell application "Finder" to move l to (make new folder at f with properties {name:my m_d_h_m_s()})
end adding folder items to

Save it (as a script) to your Folder Actions folder and then, using the Folder Actions Setup Utility, attach it to the required ‘hot’ folder. :slight_smile: