Thanks for the reply. I figured it was something like that (as it's been many years since I've done any Applescripting), but alas, either I didn't grok your hint or we're both off the beam. Saving the following as an app, and dropping an empty folder named "123_1221" onto the app, results in two strange behaviours: (1) there's no output from the first display dialog, and the latter throws an "thisPath not defined" error. Grrr.
-- For a droplet, you use a special handler called an open handler…
on open theseItems
tell application "Finder"
repeat with thisItem in theseItems
if kind of thisItem is "folder" then
try
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {":"}
set thisPath to path to thisItem as text
set xyzzy to last text item of thisPath
display dialog "in: " & xyzzy -- fails: no output; why?
set AppleScript's text item delimiters to oldDelims
on error
set AppleScript's text item delimiters to oldDelims
end try
display dialog "out: " & thisPath -- fails, thisPath not defined; why?
-- Convert folder names "xxx_MMDD" to "YYYY-MM-DD"
(*
set pixMonth to text 6 thru 7 of folderName
set pixDay to text 8 thru 9 of folderName
*)
else
display dialog "error: only folders, please."
end if
end repeat
end tell
end open