Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Attachment not included with Scheduled Script

Featured Replies

I have a script running at 30 minute intervals with an attachment. The attachment works fine when I run the script manually. However, during the schedule, the file does not attach.

The first thing I do in the script is set a variable:

Set Variable [$_filepath; Value:Get ( DesktopPath ) & "_revision-" & TimeStamptoString ( Get ( CurrentTimeStamp ) ) & ."xls"

The custom function TimeStamptoString ( Get ( CurrentTimeStamp ) ) is self-explanitory, though one can read more about it here ( http://www.briandunning.com/cf/117 )

Later, I export data (see screenshot).

Finally, in the SendMail script step (which is otherwise working fine), the subject includes Get ( CurrentTimeStamp ), so that the emails appear separately (I'm testing in Google, which lumps all the emails of the same recipient/same subject together).

In the variable above, I was using Get ( TemporaryPath ), but I changed it to the Desktop in order to debug.

Also, it should be noted that while I have access to FMP10 Server, I do not have access to the server machine. I know it is a Windows machine, but that is all I know about it.

Can anyone help?

Thanks.

Output_file.png

The files need to be on the server, in the server Documents folder.

  • Author

Interesting. So the path needs to be something like this:

File Path: /C:/Documents and Settings/myFolder/myFile

Is that correct?

Why doesn't Get ( TemporaryPath ) or Get ( DesktopPath ) work? It seems like both would point to the server since the script is called from the server in a schedule.

Thanks.

  • Author

Still not working; I have tried the following without any success:

Get ( DocumentPath ) & File.xls

Get ( TemporaryPath ) & File.xls

Get ( DesktopPath ) & File.xls

C:/Documents and Settings/subFolder/File.xls

/C:/Documents and Settings/subFolder/File.xls

C:/Documents and Settings/Administrator/My Documents/File.xls

I also tried this -

"C:Documents and SettingsAdministratorMy Documents" & "File.xls"

- it didn't work because I cannot put a "" after "My Documents".

So, I'm really confounded. When I run the script from the client (Macintosh), the SendMail properly finds the file and attaches it. However, when I run the script from a server schedule (Windows), I receive an email without the attachment.

Can anyone shed some light on what I am doing incorrectly?

Thanks.

Interesting. So the path needs to be something like this:

File Path: /C:/Documents and Settings/myFolder/myFile

Is that correct?

Why doesn't Get ( TemporaryPath ) or Get ( DesktopPath ) work? It seems like both would point to the server since the script is called from the server in a schedule.

Thanks.

First, RTM and Help on file references. The form is:

"file:" & get( documentspath) & "abc.xls"

Second: how do you know it isn't working?

You said you don't have access to the server; so you don't know what is actually in the Documents folder.

You also do not describe how you put the file into the documents folder in the first place. How does it get there so it can be attached?

  • Author

First, RTM and Help on file references. The form is:

"file:" & get( documentspath) & "abc.xls"

Second: how do you know it isn't working?

You said you don't have access to the server; so you don't know what is actually in the Documents folder.

You also do not describe how you put the file into the documents folder in the first place. How does it get there so it can be attached?

Thanks, Bruce. I thought I had researched this properly before posting, but obviously, I was mistaken. To that end, this explains the process: http://help.filemaker.com/app/answers/detail/a_id/7035

My final variable is defined thusly:

"filewin:" & Get ( TemporaryPath ) & "fileName-" & TimeStamptoString ( Get (CurrentTimeStamp) ) & ".xls"

Also, many thanks to my friends at Beezwax Datatools for their suggestions (sent directly to me).

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.