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

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

Recommended Posts

Posted

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

Posted

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. 

 

Posted

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

Posted
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.

Posted

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?

Posted

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'.

Posted

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

Posted
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.

 

Posted

Thanks for the help!

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

 

Posted

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

Posted
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.

Posted

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.

 

Posted
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?

 

Posted

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.

 

Posted (edited)

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

This topic is 1831 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.