Solved

How to open multiple Excel spreadsheets in Filemaker Pro 10

Posted on 2013-02-05
10
515 Views
Last Modified: 2013-08-23
I have a database that has a field which contains the file path to an associated excel spreadsheet for that record. In a find set, how would I open all of the associated Excel spreadsheets for those records. I am using Filemaker Pro 10 for Windows. I tried using the Send Event "open document/application" command in a script but it only opens the spreadsheet of the currently selected record, not all of the records in the find set. I would also like to be able to open other types of files (Word docs, PDF's etc.)
0
Comment
Question by:JohnnyObbq
  • 5
  • 4
10 Comments
 
LVL 24

Expert Comment

by:Will Loving
ID: 38857537
You would simply need to add a "Loop/End Loop" to the script, like this:

Go To Record [ First ]
Loop
   Set Variable [ $FilePath ; Table::FilePathFieldName ]
   Send Event [ "Microsoft Excel.app" ; "misc" ; "dosc" ; "$FilePath" ]
   Go To Record [ Next ; Exit After Last ]
End Loop
0
 

Author Comment

by:JohnnyObbq
ID: 38857682
Is there a way to limit the number of records opening, if somebody accidentally ran the script with all records found it could cause a big problem if say 100 records were avalable.
0
 
LVL 24

Expert Comment

by:Will Loving
ID: 38857746
Yes. Add a variable called $Counter and set it $Counter + 1. The add an Exit Loop [ ] step with the max number of docs to open.

Go To Record [ First ]
Loop
   Exit Loop [ $Counter >= 11 ]
   $Counter [ Value: $Counter + 1 ]
   Set Variable [ $FilePath ; Table::FilePathFieldName ]
   Send Event [ "Microsoft Excel.app" ; "misc" ; "dosc" ; "$FilePath" ]
   Go To Record [ Next ; Exit After Last ]
End Loop
0
 

Author Comment

by:JohnnyObbq
ID: 38861698
If I wanted to do something similar with different types of files I have a question. Currently with the script, it is using whatever the Windows default program is for the particular file extension. If I wanted to use a different program than the Windows default, how would I accomplish that.
0
 
LVL 24

Expert Comment

by:Will Loving
ID: 38861858
I believe the Send Event configuration lets you select the application you wish to use to open the file with. If your Send Event script step currently says "unknown" then I assume it will use the default. Instead specifically select the application you wish to use by clicking "Specify Application". This is a Mac screen shot below but it should be the same layout for the dialog.

In this screen shot, I'm specifying that a PDF be opened in "Adobe Acrobat Pro" rather than the default "Preview" or "Adobe Reader".

Send Event Dialog
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:JohnnyObbq
ID: 38865375
In the windows Filemaker Pro 10 version there is not a "Specify Application" selection

Send Event Dialog
0
 
LVL 24

Accepted Solution

by:
Will Loving earned 500 total points
ID: 38865559
In Windows, you have to specify it explicitly in the calculation. See the following FileMaker Knowledgebase article: http://www.filemaker.com/11help/html/scripts_ref2.37.69.html

----------------------------

To launch the Notepad application, select the open document/application message, click File, and specify notepad.exe. The following script step appears in the Script Definition dialog box:

Send Event ["aevt"; "odoc"; "NOTEPAD.EXE"]

To open a document created by another application, select the open document/application message, click File, and specify the file (for example image.bmp). The following script step appears in the Script Definition dialog box:

Send Event ["aevt"; "odoc"; "image.bmp"]
0
 

Author Comment

by:JohnnyObbq
ID: 38865885
If I am understanding it properly, how would I be able to specify both actions as in my script one is specifying  a File and the other one is specifying a Calculation, you can't select both.
0
 

Author Comment

by:JohnnyObbq
ID: 38869432
This is what the script looks like:

Applicatio Launch Script
0
 
LVL 2

Expert Comment

by:ozbigben
ID: 38870489
Define the file path in the calculation.  If you have different conditions for using each, then set these up with if/case statements within the calculation, possibly passing extra info for the condition as a script parameter. Alternatively you may want to have the conditional statement as part of the script, using a different event for specific file types and a generic open document event for everything else.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now