According to the documentation, saving a copy without a dialog is not a part of that script step:
Why don't you just backup the data somewhere instead of the entire file? People can't make changes to the layouts, schema or scripts in go, so the file will not be changing, only the data. There's tons of filemaker go oriented sync solutions out there, including FMEasySync, which is free. Also this way, you can set to only backup new or changed data, rather than the entire file, which keeps your backup size down.
Michelle, the following script steps work on my iPad:
set variable[ $file: Value: Get (DocumentsPath) & "file_name.fmp12"]
SAve a copy as [$file; copy]
Send Mail [Send via E-mail Client; "$file"] (specify all of your email settings in this step)
What is the file path you are specifying in the send mail script step?
Thanks all for the replies and suggestions.
RGordon: your idea worked. I tried something similar shortly after I posted. It needed a pause script step in-between the two steps. I'd found that suggestion in a few other posts. When I added a .5 second pause, all worked as it should. I think that gives time for the file to be saved.
Mike: Will be using MirrorSync to sync with server hosted file soon. This is interim solution. Thanks for the suggestions, though.
Todd: The file path that works is to use Get(TemporaryPath) & whatever file name you want specified for the file. I set a variable $Path at the beginning of the script and then the variable is the path indicated for the file. No problem saving the file, just a lag in getting it attached. I was hoping that the Send Email option would have some method of defining the TO: etc. but it doesn't, so the Send Mail step was required. (TemporaryPath works on the iOS device).
Whenever I have a script that should work but doesn't work in Go, a brief pause or commit record solves the problem a majority of the time.