Re: Can I...
Re: Can I...
- Subject: Re: Can I...
- From: Richard 23 <email@hidden>
- Date: Fri, 19 Jan 2001 00:59:01 -0800
>
Ok, I'm just getting into learning AppleScript. I've read most of the stuff
>
on Apple's site and a couple of other tutorials, but I'm running into
>
problems with what I want to do. What I want is this:
>
>
I'll have two files. One's a text file, the other is a jpg. I drop them into
>
a folder (using folder actions). The jpg gets opened in GraphicConverter,
>
resized to a certain size, saved with a certain name. Then both the txt file
>
and the finished photo get uploaded to a certain spot on a certain web
>
server automatically (I suppose I'll have to use Interarchy?).
>
>
Can this be done... and if so, can it be done with one script? Any
>
recommendations will be appreciated.
Yes. and Yes.
I've done something similar for text files. I run the script from OSA
Menu.
It looks at the frontmost applications first window. If the window is
dirty
(the file's been modified), it saves the file, gets the path from the
window
(my script was written with Alpha, BBEdit and Tex-Edit Plus in mind). It
also
searches the document for the upload path. The document is usually a
script
or html document with the path commented out and in a format that's easy
for
the script to locate, eg:
# directory: richard23/info/
My script uses Fetch rather than InterArchy. I'm sure either would be
fine
but I think Fetch has a fuller dictionary. The script checks Fetch's open
windows. If a window is already open for he target site the username/pw
won't be needed, otherwise my script looks in its folder for login info,
failing that, the user is prompted for the info. If a window for the
target
directory wasn't already open, it is opened (If you open without looking
first a new window will be opened each time, kinda messy if you upload
several files). Then the file is uploaded to the directory's window, the
permission setting adjusted (if a perl script) and if a browser is open
to the file that was just uploaded, that window is reloaded.
Hopefully this little synopsis will give you some ideas on how to write
yours. If you have any specific questions or get stuck, feel free to
email
me and I'll give you some assistance.
R23