Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Send Event is no longer working in FM18 under Catalina

Featured Replies

Aggravating behavior.

I've got some send event commands that still work with FM18 under Mojave, but do not work under Catalina.

Pretty simple commands - one is to simply open up a directory and the other is to launch an MP3 file using whatever the default media player is (I've tried leaving it a the new "Music" app and as Quicktime player. These files play fine when launched on their own but I can no longer launch them using the send event command.

Also, for what it is worth, If I try to set an application (versus a document) in the send event script, It never changes - still says <unknown> at the top. Odd indeed.

 

Any help would be appreciated

I don't think I have ever used the Send Event command in macOS. There is practically zero documentation for it anywhere, not just in Filemaker. I suggest you use Perform AppleScript instead. 

 

  • Author

Thanks for the reply. That send event command has been in this solution since probably FM 5 or 6 and has always worked. I'll try the Perform AppleScript and see what happens

4 minutes ago, Blaze said:

I'll try the Perform AppleScript and see what happens

Please report your findings. Because if AppleScript stopped working, that would be a disaster.

  • Author

I'm not having any luck with Applescript either. Searching on the web turns up various reports of similar difficulties.

I've tried numerous code variations both calculated and native script and come up with bupkis.

I'm just trying to have filemaker launch an MP3 file. Not much coding involved there at all. Anyone got any suggestions?

What happens if you perform the following as native AppleScript:

tell application "Finder"
	set myFile to choose file
	open myFile
end tell

You should get a dialog to select a file. Navigate to your MP3 file, select it and click 'Choose'.

  • Author

I need to be able to provide "my file" in the form of a calculated result, not a dialog (or native applescript). Each record in the database has its own associated audio file so it needs to be summoned according to the record's file reference

1 hour ago, Blaze said:

I need to be able to provide "my file" in the form of a calculated result,

I understand that. But I am trying to establish what works on your system and what doesn't. So I am starting with something basic. If that works, we can move forward. If it doesn't, then something is very wrong.

 

  • Author

Thanks for the help!

Yes it does open to the Applications folder and I can navigate to a file from there and launch it.

 

OK, so now we need to give it the path to the actual file. What is stored in your database and where exactly are these files?

  • Author

The overall database is a runtime comprised of a single table.

The filepath is calculated in Filemaker by using the usual Get functions

The filepath to the individual files that need to be played is 

Macintosh HD/Applications/RealBookSoftware5.02m/Materials/

and then followed with the file name. For example...

Macintosh HD/Applications/RealBookSoftware5.02m/Materials/123.mp3

I've tried scripting it with both / and

The filepath is calculated in Filemaker by using the usual Get functions

2 minutes ago, Blaze said:

The filepath is calculated in Filemaker by using the usual Get functions

I am not sure what that means. 

Let's say you have a global field (or a calculation field) named Folder that contains:

Macintosh HD/Applications/RealBookSoftware5.02m/Materials/

and a field named Filename that contains:

123.mp3

Then performing a calculated AppleScript:

Let ([
AS_filePath = Substitute ( YourTable::Folder & YourTable::Filename ; "/" ; ":" ) ;
template = "tell application \"Finder\"¶
  open file \"«AS_filePath»\"¶
end tell"
] ;
Substitute ( template ; "«AS_filePath»" ; AS_filePath )
)

should result in opening the file.

  • Author

That did the trick.

I've never done much with Applescript, since this runtime is for both Windows and Mac, with Mac users a very small minority and the send event command always worked just fine until Catalina.

I can't thank you enough for being so generous with your time and knowledge.

 

3 hours ago, Blaze said:

this runtime is for both Windows and Mac

Can't you use a cross-platform method, then? Like Open URL or inserting the file (as reference) into a global container and selecting it to open?

 

  • Author

I tried the URL method. That didn't fly. Global won't work becasue there are hundreds of mp3s that need to be able to be launched within the program.

The send event command has worked just fine for the 13 or so years I've had it implemented in this solution.

Seems like maybe one of those dark corners that filemaker didn't take care of when navigating the choppy upgrade waters of Catalina. Apple is notorious for bugs and challenges forced on developers and users alike whenever they roll out a new OS.

 

Oh boy. You're so quick to dismiss things, you are missing out on so many cool opportunities.
 

19 hours ago, Blaze said:

I tried the URL method. That didn't fly.

The URL method should be very convenient for you, because with a runtime you can place your files in a known location relative to the application. So if the Materials folder is in the same folder as the runtime engine, you should be able to use:

"file:/" & Get (FileMakerPath) & "Materials/" & YourTable::FileName

as the URL to open (untested on Windows).
 

19 hours ago, Blaze said:

Global won't work becasue there are hundreds of mp3s that need to be able to be launched within the program.

But you launch them one at a time, do you not? So you can insert the file you want to open in a global container, and then double-click the container. Or you could use an unstored calculation field - that would reduce the scripting to a single step. Again, the advantage here is that the path can be relative to the file - see the attached demo.
 

19 hours ago, Blaze said:

Apple is notorious for bugs and challenges forced on developers and users alike whenever they roll out a new OS.

I don't see it that way. IMHO Filemaker carried a technology long past its usefulness - just like they did with OLE at the time.

 

demo.zip

Edited by comment

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.