iOS Variables from FileMaker

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Tester2
Posts: 102
Joined: Wed May 18, 2011 7:02 pm

iOS Variables from FileMaker

Post by Tester2 » Tue May 22, 2012 6:15 pm

Hey guys,

Do you know if there is a way that LiveCode can take in information from another application (like FileMaker Go), through either a variable or field?

So if I have a script coming from FileMaker Go with a variable (i.e.: $Message) can I somewhere put that information into a field or variable in LiveCode?

Thanks.

-Tester2

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: iOS Variables from FileMaker

Post by Mark » Tue May 22, 2012 10:02 pm

Hi,

I looked into this some time ago. You can always open an app by using a URL, provided that the plist file of the target app contains a protocol and it is possible to add parameters to the URL. Apps created with e.g. Phonegap can read those parameters, but LiveCode can't (I'm using LC 5.0.2). Maybe you can file a feature request in the quality control centre.

A solution could be to make Filemaker write to a server and have LiveCode read the file from there. It might also be possible to do something with shared files (which you can see in iTunes).

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Tester2
Posts: 102
Joined: Wed May 18, 2011 7:02 pm

Re: iOS Variables from FileMaker

Post by Tester2 » Tue May 22, 2012 10:41 pm

Hey Mark,

I banged my head against the wall for awhile with this today, but I actually found something that worked.

With the new LiveCode 5.5, you can specify a custom URL scheme for your app. I used this to easily open my LiveCode app from FileMaker Go. To pass variables from FM Go, I included them in the custom URL ("customURL://" & $$Number & " " & $$Message) and then disected them on the LiveCode end:

i.e.: put mobileGetLaunchUrl() into tURL
put tURL into field messagefield
replace "%20" with " " in field messagefield
replace "customURL://" with "" in field messagefield
put first word of field messagefield into field number field

In this way, I was able to pass the content of my FM Go Message field and Number field by using the custom URL scheme in LiveCode.

It's not the easiest of methods, but it worked! :?

Post Reply