Re: Script to save webloc
Re: Script to save webloc
- Subject: Re: Script to save webloc
- From: "Michael Grant" <email@hidden>
- Date: Fri, 9 Jan 2009 18:56:54 -0600
On Fri, Jan 9, 2009 at 3:03 PM, Scott Haneda <email@hidden> wrote:
> Hi everyone, thanks for all the help on this one. I will work through all
> your suggestions and adapt bits and pieces to get where I need to go. I
> have one small question.
>
> One of the nice things about my original use of the webloc file, it is took
> care of a lot of things. For example, it dealt with non valid chard in the
> filename, that the Finder does not like.
>
> I am now passing my filename var through a small do shell script to remove
> non alpha nunerics, which seems to work well.
>
> The second item I can not solve, is duplicate file names. In my solution, I
> do shell script and echo a value into a file name with redirection ala ">".
> If the html file name is the same as another one, the old one will get
> wiped.
>
> With the webloc, it would append a 1 or number increment to the filename,
> and I did not have to think about it. I can timestamp the files, and that
> will give me a better chance of this not happening. Any chance there is
> something built into AS that covers this? I suppose the second I drop down
> into using do shell script any chances of that are gone. However, even my
> AS native file writes are also doing just what they should, write to the
> file.
>
> If there is any way to get file name collisions to be a little safer, it
> would be a nice one to learn.
The script I sent earlier today takes care of the duplicate filename
issue by using the choose file name command, which is part of Standard
Additions -- works just like a standard Save dialog. I'm not 100%
sure, but it should handle the invalid characters issue as well.
Michael
--
You have to be happy with what you have to be happy with what you have
to be happy with.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden