Update:
The following code (liveCode 5.5.3) is supposed to launch a FileMaker script (and return eventual errors to Livecode):
Code: Select all
on error resume next
Set FMApp = CreateObject("FMpro.Application")
Set FMfiles =FMApp.Documents.Open("C:\Users\TrevixB\Documents\CC_SaniMont_fm12\CC_preferenze.fmp12","UserName","Password")
If Err.Number <> 0 Then
Set FMApp = Nothing
result = Err.Number
Else
FMfiles.DoFMScript ("Script_ToDo")
If Err.Number <> 0 Then
result = Err.Number
end if
Set FMApp = Nothing
End If
It works fine on the devolpment but, if run from a standalone, FileMaker "believe" that I am trying to open again the file "CC_preferenze.fm12" (not possible since it is already open and shared trough FileMaker) and it wont let me do it (I've checked the script on the standalone and it is the same as on development) :

- Cattura.PNG (10.67 KiB) Viewed 9570 times
The problem, I believe is the CreateObject("FMpro.Application").
It works if I put the script in a text file "thetext.vbs". And it works on the "development" environment but not on "standalone".
I tried to use a GetObject("FMpro.Application") but I've got error (424).
Any idea of what is going on ?
Thanks
Trevix