Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to open multiple Excel spreadsheets in Filemaker Pro 10

Posted on 2013-02-05
10
521 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 25

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 25

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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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 25

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
 

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 25

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

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…
Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

828 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