• 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: Mike Bautsch <email@hidden>
  • Date: Sun, 22 Feb 2004 22:39:20 -0500

This is great, except in my example I made a mistake. Where I put "So if todays date is 2/22/2004 the file name would be "20040222-da.csv"." I should have put that I need to add a day to the date so the the file name would actually be "20040223-da.csv". The download is the next day's date. Is it easy to modify what you have given me here to just add a day to the date before converting it to the new format?

Thanks,

Mike

On Sunday, February 22, 2004, at 09:36 PM, Andrew Oliver wrote:

It sounds to me like you're making this more complex than it needs to be.

You don't exactly say how you're downloading the file, but I'll assume http,
although any other standard URL should work.

If that's the case, you can just:

set remote_filename to (do shell script "date +%Y%m%d") & "-da.csv"

tell application "URL Access Scripting"
download ("http://some.server.net/path/to/"; & remote_filename) to file
"Macintosh HD:da.csv" replacing yes.
end tell

This takes care of all the issues you raise. It lets you specify the local
filename without having to download and rename, and it lets you put it in a
standard location so FileMaker can find it. Additionally, the 'replacing
yes' means you don't have to worry about cleaning up afterwards.

Andrew
:)

On 2/22/04 5:09 PM, "Mike Bautsch" <email@hidden> wrote:

I need to construct an applescript to automate the download of a file
to be imported into a filemaker database on a daily basis. I am very
familiar with the process of importing into filemaker with applescript
but I am not familiar enough with applescript to construct the name of
the file based on the date and then changing the name of the file
downloaded to a name that will always be the same so filemaker can grab
it.

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.
_______________________________________________
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.
_______________________________________________
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: Michelle Steiner <email@hidden>
References: 
 >Re: constructing file name (From: Andrew Oliver <email@hidden>)

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