Re: copying and pasting the date into programs
Re: copying and pasting the date into programs
- Subject: Re: copying and pasting the date into programs
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 03 May 2001 05:54:27 -0700
On 5/3/01 4:57 AM, "Melissa Terwilliger" <email@hidden> wrote:
>
Hi, I just started learning apple script about a week ago and my work wants
>
me to write an applescript that will copy the date into whatever program you
>
wish. I have enough of the script written that the Date is copied to the
>
clipboard, but I have been unable to get it to automatically paste into the
>
proper application. (I know they could just hit command-v but hitting 3
>
keys to get the date I guess is to much work)
>
>
I've tried to identify by ID and any other way I have read about, but I just
>
can't seem to figure out how to have it paste into the proper program when
>
the person has 12 apps open. I was hoping someone here could help.
>
Melissa,
Generally speaking, applescripts can only work with applications that are
scriptable: where the developers of the applications have made the decision
- and the work involved - to implement AppleScript. So if the application in
question is a text application which is scriptable, there will be a way -
otherwise not. You could write a fairly complicated script, which determines
which application is involved and has a different script solution for each
(although many will be similar), using the terminology of each application's
AppleScript dictionary, and beeps and flashes an error if the application
isn't scriptable. (You wouldn't need the clipboard, either.) It just may be
that every application they have in mind is indeed scriptable, but unlikely.
One assumes that they are all text-based. This is still probably not what
they had in mind.
If your employers were to get a macro utility such as OneClick, KeyQuencer
or QuicKeys, this could be done the way they want with the utility's
scripting (not applescript), although the application would have to be
brought to the front to do the job.
When you say "will copy the date into whatever program you
wish", how do you want to do the choosing of the application? By a dialog on
the screen? Or by what application is in front? In any case, I would
recommend OneClick, available at
http://www.westcodesoft.com, although the
other utilities mentioned will do this too.
Just out of interest, what are the applications in question? You never know,
maybe they're all applescriptable (farfetched). Just so you know -
SimpleText is not.
--
Paul Berkowitz