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: Fri, 15 Aug 2003 23:12:05 +0100
on Fri, 15 Aug 2003 14:07:28 -0500, David Durkee <email@hidden> wrote:
>
I just tried this, which worked for me. The main difference is that I'm
>
using the standard addition "set the clipboard to" instead of using the
>
Finder to set the clipboard, which did not appear to work.
>
>
tell application "FileMaker Pro"
>
set texttocopy to cell "Publisher email" of database 1
>
set the clipboard to texttocopy
>
end tell
>
tell application "Microsoft Word"
>
paste
>
end tell
Remember that, for the 'set the clipboard' to work properly, the target
application needs to be frontmost.
In a previous message, Kelvin Aitken said:
>
> It will work faster if you skip the "activate" command.
- which is true for FileMaker Pro (but not necessarily for other apps).
However, if you don't activate FileMaker, and then tell it to set the
clipboard to something, the command is unlikely to work. If no application
has been explicitly activated, it might be safer to use something like (all
one line):
==============================
tell application (path to frontmost application as string) to set the
clipboard to textcopied
==============================
FWIW, in Courtney's original question (Thu, 14 Aug 2003 16:06:10 -0500), he
tried this:
>
Tell application "FileMaker Pro"
>
Activate
>
Select (data of cell "z_yearMonthSpreadsheet")
>
Copy
>
End tell
In a situation like this, I'd probably go for the 'set the clipboard'
approach too. However, to help clarify why the above failed (and to
demonstrate the usefulness of the 'do menu' command), here's a syntax
example that should work:
================================
tell application "FileMaker Pro"
activate -- required for the "Copy" command below
go to cell "z_yearMonthSpreadsheet" of database "Hours_.FP5" -- select
do menu menu "Edit"'s menu item "Select All" -- select cell's contents
do menu menu "Edit"'s menu item "Copy" -- copy the selection
end tell
================================
(To deselect after copying, add the line: go to database "Hours_.FP5")
---
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.