September 10, 20214 yr I have several container fields in my database and I would like to set them up so that when a file is dragged into them it automatically renames it. Each container field will rename the file dragged into it in the accordance of the field it goes into to. Example container field1, renames it to Field1.zip, container 2, Field2.zip, etc..... I have the script set to go off in set script triggers under OnObjectModify. I know the path where the file will be stored. I just can't seem to get it to figure it out. Do I need to use the "rename file" command in a script? I am trying this and it is telling me it Rename File [ : "change.log" ; New name: "change1.log" ]
September 10, 20214 yr Your question seems to be cut off in the middle, and it's not clear what exactly the problem is. AFAIK, if you drag a file into a container field, the data is embedded in the container field - so there is no file that can be renamed. You may be able to export the file to a known location, rename it there and reinsert it into the container field (I haven't tested any of this). -- Note also that having numbered fields is a symptom of poor structure*. And I believe that using invalid field names will bite you at some point. (*) I now see that I am repeating myself: https://fmforums.com/topic/108209-script-that-downloads-the-file-associated-with-the-button-clicked-on/?do=findComment&comment=486828&_rid=72594 Edited September 10, 20214 yr by comment
Create an account or sign in to comment