Re: newbie question
Re: newbie question
- Subject: Re: newbie question
- From: "Marc K. Myers" <email@hidden>
- Date: Thu, 14 Jun 2001 13:40:42 -0400
- Organization: [very little]
>
Date: Wed, 13 Jun 2001 23:28:31 +0200
>
Subject: Re: newbie question
>
From: Jan Pieter Kunst <email@hidden>
>
To: AppleScript <email@hidden>
>
>
Lawrence M. Borland, M.D. (email@hidden) schreef op 13-06-2001 22:24 :
>
>
> After 2 days of "reading the AppleSript and Clarisworks dictionary and
>
> Goodman's AppleScript Handbook V2, I have the following but it does NOT
>
> place the contents of the result window (of Script Editor) into the Finder
>
> CLIPBOARD. I have tried a variety of terms but usually they return an error
>
> that the clipboard cannot be set to <<script>>, etc.I realize that there
>
> are also some redundancies (such as get path to "Clarisworks" that I would
>
> not necessarily need.
>
>
>
> Q1 Copying to FINDER clipboard should be SO.... simple. What am I missing.
>
>
I'm an Applescript newbie myself, and I had this same problem a while ago.
>
It turned out that I had to phrase it like this:
>
>
tell me to activate
>
set the clipboard to ...
>
>
where "me" is the script itself.
>
>
In your case, I'm not sure if using the clipboard is the best way to
>
accomplish what you are trying to do. How about something like this
>
(pseudo-code, this doesn't actually work):
>
>
set fileList to to the name of every file ...
>
>
tell application "ClarisWorks"
>
activate
>
set text of active window to fileList
>
>
In other words, pass the text to Clarisworks in a variable, not through the
>
clipboard.
I agree that the text should be passed in a variable rather than through
the clipboard. In addition, you'll need to change the format of
fileList. As written, fileList is a variable containing a list.
AppleScript lists are not a format recognized by ClarisWorks and will
produce erroneous results. You need to convert the fileList to a
variable containing text:
set {od, AppleScript's text item delimiters} to {AppleScript's text item
delimiters, {return}}
set fileList to (fileList as text)
set od to AppleScript's text item delimiters
Now fileList will contain the file names separated by carriage returns.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[6/14/01 1:40:21 PM]