I’ve had a lot of experience with HyperCard scripting but none with AppleScript. I have a couple of questions that hopefully someone can answer.
Can someone direct me to an AppleScript script that I could use to transfer numbers from a HyperCard field to an Excel column ?
I’m using OS X 10.2.8 and when I try to run the “Setup Script Menu” applet, it gives me a message “Script Menu menu items not found in the Menu Items folder.”
Go to your AppleScript folder (within the Applications folder) and look for an item named Script Menu.menu. Double click its icon. This should put the script menu in the menu bar. I can’t help with your HyperCard/Excel question.
Thanks for the response Rob, but I have already done that and it doesn’t respond. It just sits there and doesn’t open or execute in any manner. That’s why I tried the Applet I mentioned before.
I considered reinstalling the System software but I have upgraded from 10.2 to 10.2.8, so the installer won’t overwrite a newer install. I’m leery about doing a clean install and then trying to upgrade all the way up to 10.2.8 again just to find I have the same version of “Script Editor” again.
I am also beginning to suspect that I may need to run the OS 9.2 version of SE to execute hyperCard commands. I’ve learned that earlier versions of SE had a command “Do script” which would execute a HyperCard script within a stack. I’ve been able to get SE to open a hypercard stack but the “Do script” command is not accepted by either version 1.7 (OS 9.2) or version 1.9 (OS 10.2) of SE.
Do you know if there is a way to upgrade “Script Editor” by itself.
I really know nothing about scripting Hypercard. When you refer to OS 9.2, are you referring to the Classic environment of OS X? If so, I know nothing about Classic since I have never installed it on my system.
That’s the version I have on my Jaguar setup (10.2.8) and it works fine. As far as I know, it’s the latest version available for 10.2.x. If your Applications folder is not within your user folder, you might try making a copy of Script Menu.menu within your user folder and then double click its icon. Maybe it’s a permissions problem.
– Rob (who uses FastScripts because it’s superior to Apple’s script menu)
I’m working on an AppleScript handler to transfer data from a HyperCard field to an Excel (Vers 2001)column.
The script sets a variable to the HyperCard field values using the “Copy to” command
Copy (line 1 of field “XYZ”) to myData
Then within a handler I tell the Excel program to activate which it does.
I tell it to locate a specific named worksheet which it does
I then select a cell and paste.
Here’s the weird thing.
The first time I ran this it worked perfectly. But subsequently, it pasted the statement <line 1 of field “XYZ”> instead of the field content. It continued to do this even after I changed the script to variations such as:
Copy field “XYZ” to srcData
set myData to field “XYZ”
I tried changing the variable name, I restarted Excel. I restarted the HyperCard stack. Nothing seems to restore what worked once.
OK, I’ve got another piece of the puzzle. I tried the script this morning without restarting the computer and now it pastes a word I was using in a search engine later last night so it has something to do with Excel and Classic mode’s copy/paste. I ran into this with another program and Excel as well but this is the first time I’ve encountered it with HyperCard and Excel. Anybody have any suggestions?
The latest version of the script which I’ve played with since it worked once is:
– button script
on mouseUp
set srcData to field “closePR” – I’ve tried variations of this w/o success
getExcel(srcData)
end mouseUp
– the above is activated by clicking on a button
on getExcel(myData)
tell application “Microsoft Excel”
activate
activate worksheet “FirstSheet”
Select Range “R2C3”
Paste
end tell
end getExcel