Re: constructing file name
Re: constructing file name
- Subject: Re: constructing file name
- From: Andrew Oliver <email@hidden>
- Date: Sun, 22 Feb 2004 18:36:00 -0800
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.