Solved

How to open multiple Excel spreadsheets in Filemaker Pro 10

Posted on 2013-02-05
10
517 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

920 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

13 Experts available now in Live!

Get 1:1 Help Now