Re: Scripting copy and paste commands in FileMaker
Re: Scripting copy and paste commands in FileMaker
- Subject: Re: Scripting copy and paste commands in FileMaker
- From: kai <email@hidden>
- Date: Sat, 16 Aug 2003 05:46:22 +0100
on Fri, 15 Aug 2003 17:39:00 -0500, David Durkee <email@hidden> wrote:
>
On Friday, August 15, 2003, at 05:12 PM, kai wrote:
>
>
> Remember that, for the 'set the clipboard' to work properly, the target
>
> application needs to be frontmost.
>
>
It worked for me without FileMaker or Word being frontmost. (As you can
>
see, there are no activates in my script and I ran it from Script
>
Debugger, so it remained active at all times.) "Set the clipboard to"
>
is a scripting addition, not a command of FileMaker so it really
>
doesn't matter what's in front when you use it. (For clarity, I should
>
have put it outside the tell block.) I tested this in Mac OS X
>
(10.2.6), and I'll readily admit that it might work differently in
>
older OSes, especially 9ish ones.
This from Standard Additions Dictionary (OS 10.2.3):
----
set the clipboard to: Place data on an application9s clipboard.
Use inside a tell9 block and activate the application first
set the clipboard to anything -- the data to place on the clipboard
----
If it works for you, that's fine. :-) However, since Courtney was clearly
still experiencing problems, I was merely pointing out a possible pitfall.
If writing for one system, these considerations may be of little concern.
However, for a script to work successfully on a variety of system versions
(or when offering general advice), it helps to be aware of such issues.
In OS 9 for example, this doesn't work (unless FMP has already been
activated):
--------------------------------
tell application "FileMaker Pro"
set cellVal to cell "cellName"
set the clipboard to cellVal
end tell
--------------------------------
These do work - but only when no other app has been activated (which means
that the script editor or script application will be frontmost):
--------------------------------
tell application "FileMaker Pro"
set cellVal to cell "cellName"
end tell
set the clipboard to cellVal
--------------------------------
tell application "FileMaker Pro"
set cellVal to cell "cellName"
tell me to set the clipboard to cellVal
end tell
--------------------------------
This works whatever app is frontmost when the script is run (but obviously
FMP is then brought to the front to do its stuff):
--------------------------------
tell application "FileMaker Pro"
activate
set cellVal to cell "cellName"
set the clipboard to cellVal
end tell
--------------------------------
---
kai
_______________________________________________
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.