jjb Posted July 15, 2005 Posted July 15, 2005 hi, I have a dbase with a table of users. Each user has an email address. How do I write a script to create a comma-separated list of just the email addresses of all of the users in the current found set? Ideally this should pop-up in a new window where the user could then just copy and paste it into whatever email application they needed. Seems like this should be really easy, but it's been awhile since i've touched filemaker and it's been a long week...
sbg2 Posted July 15, 2005 Posted July 15, 2005 Create a calc field My CalcField = EmailAddress & "; " Create a global text field (MyGlobal) to hold combined Emails Create a script: Go to Record First Clear [select; MyGlobal] Loop Set Field[MyGlobal; MyGlobal & MyCalcField] Go To record Next; Exit after Last End Loop Copy [select; MyGlobal]
jjb Posted July 15, 2005 Author Posted July 15, 2005 Thanks. I had set-up something like that. Unfortunately it seems to be extremely slow when dealing with more than about 1000 records. Any way to speed this up?
Lee Smith Posted July 15, 2005 Posted July 15, 2005 Hi sbg2 You have a typo in your calculation field, you used the semicolon instead of the comma. Also, you can accomplish this without a calculation field, you can do this by including that in your script. Go to Record/Request/Page [ First ] Clear [ MyGlobal ] [ Select ] Loop Set Field [ MyGlobal; MyGlobal & EmailAddress & ", " ] Go to Record/Request/Page [ Next; Exit after last ] End Loop Copy [select; MyGlobal] Not sure about the Copy Script Step, but I left it in. Lee
sbg2 Posted July 15, 2005 Posted July 15, 2005 Thanks. I had set-up something like that. Unfortunately it seems to be extremely slow when dealing with more than about 1000 records. Any way to speed this up? * Exporting MyCalcField to a text file might work, if A) you were sure only 1 user would be doing this at a time : The email programs your users run handled return seperated lists well (MS Outlook seems to handle it well and uses semi-colons not commas as a seperator, it does handle commas as a seperator (changing them to semicolons once you leave the To: field) what you use will obviously depend on what best fits the email programs your users are using). * Importing the found set into a related file and then using the ValueListItems function to set your MyGlobal field should be faster. You would need to set-up another global field that would hold a unique value for the find request so that the two tables would relate correctly (Random Number, UserName?). Again you would be dealing with a return seperated list. * I have seen people say Find/Replace is much faster than looping but have not experimented with it much.
-Queue- Posted July 15, 2005 Posted July 15, 2005 Are you freezing the window before performing the loop? That should help speed the process significantly, as might changing the layout to View as Form, if it is not currently in Form view.
Recommended Posts
This topic is 7073 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 accountSign in
Already have an account? Sign in here.
Sign In Now