• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Applescript with Excel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript with Excel


  • Subject: Re: Applescript with Excel
  • From: T&B <email@hidden>
  • Date: Thu, 01 Mar 2001 12:21:20 +1100

I know this doesn't help a lot, but perhaps offers an alternative.

I get an "out of memory" error at 'set cell "TestCell" to the clipboard'.
When I go to the Finder and check the contents of the clipboard, the
clipboard does contain the data I want it to contain.

Avoid using the clipboard in a script. Instead, set a variable to the value of an object in your spreadsheet, then set a cell in your database to that variable.

It's been a while since I've intensively scripted Excel. In AppleWorks, which probably has a better AppleScript object model, the script you need would simply be:

tell application "AppleWorks 6"
set copiedValue to cell "B3" in spreadsheet of document "My Spreadsheet"
end tell
tell application "FileMaker Pro"
set cell "TestCell" to copiedValue
end tell

tell application "Microsoft Excel"
...
CopyObject Selection

Ewww! How about this simpler approach with no clipboard:

set var1 to 12
tell application "AppelWorks 6"
set var2 to cell "M1" in spreadsheet of document "Sheet3"
end tell

activate
if var1 = var2 then
display dialog ("Dialog #1")
else
display dialog ("Dialog#2")
end if

The "display dialog" part of the script doesn't get executed. Instead, when I
run this script from Script Editor, the application menu flashes at me.

You need to activate whatever app id going to display the dialog. Simply add the "activate" line I have above.

Tom
T&B
http://www.tandb.com.au/applescript/


  • Next by Date: folder exists on the desktop
  • Next by thread: folder exists on the desktop
  • Index(es):
    • Date
    • Thread