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

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

Recommended Posts

  • Newbies
Posted

I've been using a script using a custom generated Scriptmaster plugin  that lists all of the files in a folder in the Documents folder of Filemaker Server on a Windows Server  then stepped through them and imported the files into specific tables. I created this on a test document running on the server then ported it over to a nearly identical document running on the same server. The test document has been running for almost 2 months without a hiccup.

 

The authorization steps, the creation of folders etc. is working. But now the ListAllFilesInDirectory refuses to list files, not just in the ported over script but also on the old document as well.

 

If I manually paste in the path of a file the script into the field I use for listing the files it will import the file then move it using the MoveOrRenameFile function of the plug in.

 

All I get in the field is a "?".

 

Any suggestions would be most helpful.

 

Dan

Augusta, GA

  • Newbies
Posted

UPDATE: The script on the original document is working. It's just the new script that is failing to list all of the documents in the folder.


UPDATE: Actually the original script is broken too. I realized I had tested the manual entry of the file name there as well. So ListAllFiles has just stopped working all together.

  • Newbies
Posted

There are 3 errors but we have always had these errors even when the function was working. 2 are non-server compatible errors (for some reason when the import script runs it triggers  a "Startup" script and goes through setting up certain parameters such as adjusting windows, freezing window etc that server can't do). The other is a 2009 error. I don't have my reference book with me to see what that one is and FMA help doesn't list errors that high. But once again, we've always had those errors according to the log.

 

Now the thing that I've had difficultly is finding any documentation on the path syntax for plugins generated by Scriptmaster. The paths for a Mac are different that the path that FMP itself would use to import a file. The listing feature drops the first slash when it lists files but do you need the first slash to move a file?????? I tried to list and grab files from a mapped drive on the server and never got it to work. So I was glad when I could list files in a folder in FMS/data/documents.

 

This script was started on an almost identical FM database. When I ported it over I realized that a few fields and a layout was missing. I added those then recopied and pasted the script into the production Database. All of the plugin's functions are working, just not the listing function. I'm hoping it's a syntax issue but once again I can't find any documentation of file path syntax for the function. But then again the syntax I was using on the original database is no longer working... if it's a syntax issue.

Dan

  • Newbies
Posted

If it matters: The function works when I test it on my Mac. I use an "If" statement to see which platform is in use and let it handle the path syntax. If(Get ( SystemPlatform )=1;

Substitute(Get ( DocumentsPath );Get ( SystemDrive );"") &"MyFolder/";Get ( DocumentsPath )&"MyFolder/")). ( of course I have to substitute out the drive name to create the path to get the function to work on the Mac). On the Windows Server box I just use Get(documentsPath) & folder name" which produces "/c:/Program Files/Filemaker Server/Data/Documents/& MyFolder.  (sorry if I left off a folder in that path but you get the idea). I just tested on my Mac and the function listed the files. But of course it's using the Plugin from my Mac and not the one of the server. I'm trying to find a Windows user to see what the result is on their client.

  • 2 weeks later...
Posted

When a plugin function returns a "?", it means the function is not available. Usually this indicates the plugin is not loaded in the environment where the function is called. It could be unable to load due to an error, or it could be missing from the required folder for the environment.

 
Can you confirm that the generated plugin is installed to "/FileMaker Server/Database Server/Extensions/" and that the checkbox is ticked (indicating the plugin is loaded) under "Database Server --> Server Plug-Ins" in the Admin Console? It sounds like you have tested this possibility already, but it never hurts to confirm. 
  • 10 months later...
  • Newbies
Posted

In FileMaker 13 I am getting "ERROR" returned from ListAllFilesRecursively when using the exact same path which returns the expected result from ListAllFilesInDirectory.

 

Following the example in the documentation,

 

ListAllFilesInDirectory ( "/Library/Desktop Pictures" ) returns

"/Library/Desktop Pictures/Abstract.jpg

/Library/Desktop Pictures/Antelope Canyon.jpg
/Library/Desktop Pictures/Bahamas Aerial.jpg
/Library/Desktop Pictures/Beach.jpg
...
"
 
while
ListAllFilesRecursively ( "/Library/Desktop Pictures" ) returns
"ERROR"
 
In case it matters, Java is version 7u51
  • 4 weeks later...
Posted

I am currently getting "ERROR", not 1 neither 0 when executing the ListAllFilesInDirectory function.

The plugin was created using ScriptMaster Advance and has been installed in the following folders:

- /FileMaker Server/Database Server/Extensions/myplugin

- /FileMaker Server/Web Publishing/publishing-engine/cwpc/Plugins/myplugin

- /FileMaker Server/Web Publishing/publishing-engine/wpc/Plugins/myplugin

the checkbox is ticked (indicating the plugin is loaded) under "Database Server --> Server Plug-Ins" in the Admin Console?

The script is being called from a URL statement

http://IPADDRESS/fmi/xml/fmresultset.xml?-db=DBMSNAME&-lay=LAYERNANE-script=SCRIPTName&-findany

Before trying on the server, I've tried it on a FileMaker Pro client and everything works fine. All commands contain in my filemaker script are all FMS type functions, none of them are desktop.

On the client, I had to register the plugin in a startup script. I do not remember registering the function in the FileMaker server environment. Do we have to register the function in FMS? If so, how am I supposed to do this ?

I am trying to understand what the problem could be. Does anyone has an idea?

Your help is greatly appreciated.

Daniel

Posted

Reading further on the web, I believe I've got my answer about registering the ScriptMaster plugin in FileMaker Server.

I then inserted the same register command I have in my Filemaker Pro startup script into the script being called on FMS.

I still have the same issue, the ListAllFileInDirectory function is not working.

Posted

atmospherical and Daniel,

 

The 'ERROR' return indicates that our plugin has thrown an exception somewhere. If you call the relevant LastError function (if you're using a custom plugin, it will be PREFIXLastError, so if your prefix is ABC, it'll be ABCLastError), it will provide detailed information about the specific error you ran into. 

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