Repaying help by posting small Applescripts
Repaying help by posting small Applescripts
- Subject: Repaying help by posting small Applescripts
- From: Richard Covert <email@hidden>
- Date: Fri, 30 Apr 2004 03:15:23 -0500
I would like to replay the help given me by posting small Applescripts
here. I can post the text version but how do I post entire XCode
projects? I have a couple of XCode AS apps that I would like to share
them with folks here.
is there a web site that readers of this news group use to share
scripts??
thanks
Here is a little script to add empty folders in a folder. I use it to
store articles I save from the Internet each day.
(* Description
Populate a folder with subfolders named after the parent with the
current date appended to the new folder's name.
Create one folder for each weekday (Mon-Fri)
Start with the current day
Do not create a new folder if the folder already exists
*)
--
-- Template script for a droplet which processes folders
--
on convertMonthToInteger(MonthStr)
-- your statements
-- display dialog "MonthStr is " & MonthStr
if (MonthStr is January) then
return "01"
else if (MonthStr is February) then
return "02"
else if (MonthStr is March) then
return "03"
else if (MonthStr is April) then
return "04"
else if (MonthStr is May) then
return "05"
else if (MonthStr is June) then
return "06"
else if (MonthStr is July) then
return "07"
else if (MonthStr is August) then
return "08"
else if (MonthStr is September) then
return "09"
else if (MonthStr is October) then
return "10"
else if (MonthStr is November) then
return "11"
else if (MonthStr is December) then
return "12"
end if
return returnValue
end convertMonthToInteger
on ProcessAFolder(aFolder)
--
-- Add your code here to process a single folder
--
tell application "Finder"
--copy (info for aFolder) to aFolder_record
set TodaysDate to current date
--display dialog "weekday of TodaysDate is " & (weekday of TodaysDate)
if not ((weekday of TodaysDate is Saturday) ,
or (weekday of TodaysDate is Sunday)) then
-- your commands go here
-- display dialog "Month is " & (month of TodaysDate)
repeat until (weekday of TodaysDate is Saturday)
--display dialog "weekday of TodaysDate is " & weekday of TodaysDate
copy my convertMonthToInteger(month of TodaysDate) to Mm
copy day of TodaysDate to Dd
get (Mm) & (Dd as string)
copy result to MmDd
copy (name of aFolder) & "_" & MmDd to SubFolder
--display dialog "SubFolder is " & SubFolder
copy ((aFolder as text) & SubFolder) to new_folder
--display dialog "the class of new_folder is " & the class of
new_folder
if (folder new_folder exists) then
--display dialog "found new_folder" & new_folder
else
--display dialog "Creating new_folder " & new_folder
make new folder at aFolder with properties {name:SubFolder}
end if
set TodaysDate to TodaysDate + 1 * days
end repeat
end if
end tell
end ProcessAFolder
on run
--
-- Run handler. Prompt the user for a folder to process.
--
set theFolder to choose folder
ProcessAFolder(theFolder)
end run
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.