December 28, 200916 yr Hi, I am trying for a script but feeling difficult to make it. 1) It should first copy the file into the container. 2) It should make the directory and copy the file into the directory. 3) Directory name should be as Company name + Fund Name. 4) Filename should be as FundName+sequence no. I tried by myself and using Mooplug plugin but it shows error. Hoping a kind reply. Regards, Tusif
December 29, 200916 yr Author Because I am thinking for sub folder, It would be "//" two slashes. I as doing something wrong? Actually It is creating folder but it is not copying file in it... Do you know why?
January 26, 201016 yr probably "D:" backslahes are escape sequences so to escape a escape you must add a and the part where it adds the file and exports it back should be after the If / End If and no Else just check if path exists, if no create it end if add the file and Get(ActiveFieldContents) is wrong use a proper field or variable for your filename
February 8, 201016 yr I think the backslashes may be correct; they are producing a single ( if that's what you want). I agree the End If should be after the "create folder", with no Else. I also agree to just use the name in the container field directly; I'd use GetAsText (container) to be explicit. This will only work if you embed the file (not as Reference). Whereas really it would make more sense to Insert [ reference ]. You do not really want or need to BOTH embed the file, and move the real file, do you? That creates a confusing situation for people editing the file later, as the "real" file now exists in 2 places. Maybe yo do, I don't know; but something to be aware of. GetAsText (container) will return 3 lines if you Insert [ reference ] (2 lines if from a mounted volume). The last line will be the FileMaker syntax full path to the file. The file name will be after the last slash; requires some text parsing, but not difficult. If my container is "Path::file_con" and the file was inserted as reference: Let ( [ txt = GetAsText ( Path::file_con); p_full = GetValue ( txt; ValueCount (txt) ); len = Length ( p_full); pos = Position ( p_full ; "/" ; len ; -1 ) ]; Right ( p_full; len - pos ) ) I think the biggest problem to the Export Field Contents is that you're asking FileMaker to Export Field Contents, but the path you're giving it is an OS syntax path (Windows in this case). It needs to be a FileMaker syntax path for a FileMaker command; which would require a prefix of "filewin:/" or "filemac:/", depending on the OS of the client computer. Case ( Abs ( Get (SystemPlatform)) = 1; "filemac:/", "filewin:/" ) [ slash only needed if the file path you pass does not already have one; often they do ] You would then need the "server" name, which would also be different for Windows ("D:/") or Mac ("its name"). You could see what the whole path should look like by inserting a file from your server into a container field as reference from a client on each OS.
Create an account or sign in to comment