Re: constructing file name
Re: constructing file name
- Subject: Re: constructing file name
- From: Mike Bautsch <email@hidden>
- Date: Sun, 22 Feb 2004 22:46:25 -0500
This is the type of thing I thought I would have to do. The only thing
I see wrong with this is the date is not fixed, it would have to be the
current date of any given day plus 1 day. I made a mistake in my
original post, the final output should be "20040223-da.csv" one day
ahead of the current date.
Thanks,
Mike
On Sunday, February 22, 2004, at 10:19 PM, Hanaan Rosenthal wrote:
>
Hello Mike,
>
>
Although I must admit that I like Andrew's solution better, just for
>
the hack of it, here's an AppleScript solution for naming the file
>
without using shell scripts:
>
>
set myDateString to "2/22/04" --can be many other forms of date
>
set nameSufix to "-da.csv"
>
set theDate to date myDateString
>
set yyyy to (year of theDate) as string
>
set mm to (month of theDate as number) as string
>
if (length of mm < 2) then set mm to "0" & mm
>
set dd to (day of theDate) as string
>
if (length of dd < 2) then set dd to "0" & dd
>
set fileName to yyyy & mm & dd & nameSufix
>
>
--> 20040222-da.csv
>
>
The only issue maybe asking for the month of theDate as number in
>
10.2.8
>
>
Hanaan
>
>
On Feb 22, 2004, at 8:09 PM, Mike Bautsch wrote:
>
>
> The file name to be downloaded is always based on tomorrows date. So
>
> if todays date is 2/22/2004 the file name would be "20040222-da.csv".
>
> I'm sure I can use fetch with applescript to do the actual download
>
> once the name is in the proper format. Then I will need to change the
>
> name of the file to something specific such as, "da.csv" so filemaker
>
> can recognize it. Then delete the file so the space is ready for the
>
> next days download. I'm not really sure how to accomplish any of this
>
> except the doscript command to filemaker and using cron to schedule
>
> the applescript to run. All of this will be done in OSX 10.2.8.
>
>
>
> Any help will be greatly appreciated.
>
>
>
> Thank You,
>
>
>
> Mike
>
> _______________________________________________
>
> 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.
>
>
>
>
>
--
>
Hanaan Rosenthal * Custom Flow Solutions
>
MEDIA AUTOMATION CONSULTING
>
401-487-2957 * email@hidden
>
* www.customflowsolutions.com *
>
>
be successful... ...work less.
_______________________________________________
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.