Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7749 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

This is not really an AppleScript post, but I am hoping some of you amazing gurus out there might be able to help.

I have this AppleScript that, along with the DatabaseNames and FieldNames functions, allows me to import data from selected fields from the current found set of any open database...

tell application "FileMaker Pro"

tell database "MyDB.fp5"

set theDatabase to cell "database_g" of current record

set A_Field to cell "A_Field_g" of current record

set B_Field to cell "B_Field_g" of current record

end tell

tell document theDatabase

set the_A_Data to field A_Field

set the_B_Data to field B_Field

end tell

go to database "Data.fp5"

tell database "Data.fp5"

repeat with i from 1 to count of the_A_Data

create record with data {item i of the_A_Data, item i of the_B_Data}

end repeat

end tell

end tell

It works great, but I am hoping to make this a x-platform database. I am stumped as to how I should proceed. Can the above be replicated using Visual Basic, ActiveX or ODBC??? I would like to avoid having to build scripts into the target databases. I also would like to avoid forcing the user to perform an import or an export of the data.

Thanks in advance for your help.

Posted

I may be completely wrong, but as I see it, Applescript is the only facility that FM provides for *accepting* commands from an external source. FM can send DDE and Message commands, but cannot receive them (I don't think).

As for ODBC I haven't looked at this lately, but past discussions indicate that FM's implementation of it, is mainly for getting data out of FM, not into FM.

I'm pretty much a Mac only user, so the above comments could be completely utterly wacko.

Posted

Using Send Message or DDE to call a batch file in Windows that writes out any necessary return data (such as error codes or filenames), you can then import the result into a global and act on the result in FileMaker. You'll need to use Pause/Resumes, since FileMaker won't wait for a result before continuing on. Another option is to delete this 'info' file after each use or write out bogus data to it, then loop perpetually in FileMaker, performing the import until the global field no longer equals the bogus data. Then Pause/Resume need not be used.

FileMaker also accepts Send Keys via WinBatch or whatever program provides them. We use this to call scripts that are accessible via Ctrl-1, etc.

An interesting thing to note: using Send Message, you can communicate with command.com or cmd.exe and perform any function associated with these, such as creating, renaming, deleting, writing to/appending to existing files, moving files, getting environment, set, or path information, creating or deleting directories--all within FileMaker. Using a .tab file to then hold the result and importing this allows FileMaker to interactively communicate and perform nearly any desired function. It's unfortunate that there is less information regarding these functions than any other script steps, and these can be the most powerful in the list.

Posted

I like the added flexibility that applescript has provided for me, but living in a cross-platform world I know I need to develop some new skill sets. The guys at Datavations certainly are building some interesting tools for FM in the windows world, but the little developers community they are trying to push ( http://www.FMCDN.com/ ) is so blatantly commercial it turns me off. [Not owning a windows machine has also hampered further exploration of the dark side of the FM world.]

Posted

I use WinBatch to provide lots of functionality on the Windows platforms. It's more powerful than Applescript. You can create a .exe from a script that can then be run on anybody's PC. I usually call the .exe with command line args using DDE, and put the script into a loop to wait for the WinBatch process to terminate. It creates a file that I check for with the Troi file plugin. I have created popup calendars, complicated dialogs, file maipluations, zipping for backups, emailing, pulling contact data out of Outlook using OLE, etc. You can also install your entire solution using WB, instead of an installer.

While it's clearly a pain to have to do 2 different things depending on your platform, you can do it pretty easily using WB.

Steve

Posted

No, WB has no way into FM. However, WB can format data anyway you wish, put up dialogs, and even run scripts if they are on the scripts menu. However, I think thats backward. Have FM run scripts that control WinBatch procedures and .EXEs, and then run an import script, or do something else.

Why don't you tell me what you're really trying to accomplish?

Steve

Posted

Look to the first post in the thread (and you'll also see why this discussion of windows technology is misplaced here in the applescript forum).

This topic is 7749 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.