• 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: constructing file name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: constructing file name


  • Subject: Re: constructing file name
  • From: Hanaan Rosenthal <email@hidden>
  • Date: Sun, 22 Feb 2004 22:19:56 -0500

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.

  • Follow-Ups:
    • Re: constructing file name
      • From: Mike Bautsch <email@hidden>
    • Re: constructing file name
      • From: Mike Bautsch <email@hidden>
References: 
 >constructing file name (From: Mike Bautsch <email@hidden>)

  • Prev by Date: Re: Efficiently using whose on Address Book users
  • Next by Date: Re: FileMaker every record whose clause
  • Previous by thread: Re: constructing file name
  • Next by thread: Re: constructing file name
  • Index(es):
    • Date
    • Thread