
Steve G
Members-
Posts
62 -
Joined
-
Last visited
Everything posted by Steve G
-
I've got about 97,000 records with each record being a unique file name. The file names are everything from "Picture 1.png" to things like "724358428520_108594.TIF". What I need is a script that will look for a block of numbers in each file name, then copy that block of numbers to another field in that record. The blocks of numbers can be anywhere from six to 20 digits. They are not in the same place in every file name. They are always separated from the other components of the file name by a space, dash, or underscore. Some file names have numbers attached to letters in addition to the block of numbers I need (e.g., "coltrane-72dpi-727738.jpg"). Some file names have multiple blocks, e.g., "Roof_028_20100126_150547.jpg" or "724353767020_104967_RGB_3x3_72.JPG" in which case I would need an "all-encompassing" set of numbers ("028_20100126_150547" and "724353767020_104967" in this example, respectively). Is there ANY hope of salvaging these numbers through some clever scripting?
-
Yes, but the ASCII export substitutes those vertical tabs for the CRs that are in the field, so that's unusable without some kind of post-processing. In other words: Exporting the field contents gives me the UTF-16 file, and exporting the record gives me vertical tabs. Either way, the resulting file does not render properly despite having otherwise-correct HTML in it. I redownloaded your script and I'm getting the same errors and the same missing object, btw. It really does blow my mind that there's no way to do a straight-up 100% pure plain text export from FileMaker. BTW, I redownloaded your script and I'm getting the same errors that I got the first time I downloaded it.
-
After some Googling it appears that the cause of my woes appears to be something called a "vertical tab" character which FileMaker uses to replace a CR in any given field. If I export the record (as opposed to the field), open it in TextWrangler, S&R the vertical tab for a CR, then save, it comes out perfect. There doesn't appear to be a way to manage this inside of FileMaker so now I just need a way to do it outside. Bruce, do you have a script? I was able to do it manually in TextWrangler by copying the space between what I knew would be two lines and pasting it into the search field, then using "r" in the replace field which is what TextWrangler interprets as a CR. TextWrangler seems to interpret the vertical tab as "x0B".
-
The limit shouldn't be a problem; the most I could ever envision passing is about 40,000 characters, maybe 50,000 at most. The average is around 15,000-20,000. I'll admit I haven't done much work with shell commands. I opened your file and ran it, and got two back-to-back errors: "Object not found" followed by "Unknown error: -1728". Looking at your script, the $sourceField Set Variable command shows a function missing. Forgive my ignorance, but is there something I need to insert there?
-
There's no tabs in the field so that's not a problem. There ARE line breaks (RETURNs) but if I'm going to HTML that shouldn't be a problem. I tried your advice; I changed the script step from "Export Field Contents" to "Export Records" using the tab-delimited format. This time when I open the file in my browser it was oddly distorted. Most of my text was there but every apostrophe and quote mark was turned into a symbol that looks like a white question mark inside a black diamond. Plus, my CSS information was disabled/ignored When I tried to open the file in TextWrangler I got an alert: "The UTF-8 file...is damaged or incorrectly formed; please proceed with caution." I did a search and replace to swap the question mark-diamond for an apostrophe and resaved. The apostrophes appeared as you'd expect but my CSS info is still MIA.
-
I built a script that takes data from a number of different fields, converts it into simple HTML, pastes the aggregate information into a single text field, and then exports that text field to a file on the desktop. It all works quite smoothly. However, there's a problem and I don't know where it stems from. If I open the exported file (which has an .html extension, btw) in my web browser it renders correctly. If I upload the exported file to the web site and then open it, I get garbled Chinese characters along with a few random strings of Roman text. IOW: If I open the file locally it renders correctly, but if I open it remotely it doesn't. In experimenting I discovered that if I open the file in a text editor (TextWranger in this case), select all, make a new document, paste, and save the new document, the resulting file renders properly both locally and remotely. Further investigation shows that the file that was exported from FileMaker is almost twice as large as the file that was saved from TextWranger (29,972 bytes vs 15,009 bytes). In either case TextWrangler says that the two files contain the same amount (14,985) of characters. I think what's happening is FileMaker is exporting the field as a Rich Text file but I see no way to verify this (or change it if I'm right). This would account for the doubled file size; one is RTF, the other is ASCII. How can I get FileMaker to export my text field as plain old ASCII?
-
I have a web enabled (IWP) database that has five layouts, each representing one of five pages on the "site". A web user points his browser to the FM server and clicks on the link to get into the database. He's a guest user and the database is set up to allow guest user access without needing a login. He sees Layout #1. He clicks a link that moves him to Layout #3. He closes his browser window, opens a new browser window, goes back to the FM server and clicks on the link to get into the database again. He gets Layout #3. This is definitely a cookie thing. If, in between visits to the FM server, the web user deletes the cookie he gets from the FM server, he sees Layout #1 again. Is there any way to force Layout #1 to appear as the "home" page, no matter what?
-
Not possible in this situation. The font is to be used on a decorative certificate that's printed directly from FileMaker.
-
I have a value list built on the contents of a calculation field ("Quarter") which contains either "First Quarter", "Second Quarter", "Third Quarter", or "Fourth Quarter", then a space, then a year (2008, 2009, etc). So a typical value list might look like this: First Quarter 2007 First Quarter 2008 First Quarter 2009 Fourth Quarter 2007 Fourth Quarter 2008 Second Quarter 2007 Second Quarter 2008 Second Quarter 2009 Third Quarter 2006 Third Quarter 2007 Third Quarter 2008 Third Quarter 2009 What I want is for all the years to be together, with the quarters in logical order, like this: Third Quarter 2006 First Quarter 2007 Second Quarter 2007 Third Quarter 2007 Fourth Quarter 2007 First Quarter 2008 Second Quarter 2008 Third Quarter 2008 Fourth Quarter 2008 First Quarter 2009 Second Quarter 2009 Third Quarter 2009 So what I did was create a second calculation field ("Quarter Sort") which gives me a sorting number I can work with. "Third Quarter 2006" generates "2006 3", "Second Quarter 2008" generates "2008 2", etc. Now I'm stuck. What I need is for FileMaker to display AND use the data in "Quarter", but sort it according to the data in "Quarter Sort". This doesn't seem possible but perhaps I'm missing something. Is there a way to do this that I'm not seeing?
-
I try that but run into the same issue; names with a lot of thin characters (i, l, f, etc) measure differently than those with a lot of wide characters (w, m, n, etc).
-
One of my tables has a certificate layout that, when printed, generates what is essentially a Certificate of Merit with the person's name on it. That layout has, among other things, a field for the person's name. The field's default text size is 60pt and it works fine. The problem is that sometimes there will be more than one name in that field. It's even possible that there could be many names in there (like, 15 or more) and 60 point type won't cut it. I've managed to set up conditional formatting that will adjust font size based on the number of words. Generally this works well except when I have really long names to contend with. So when it's "John Smith, Mary Jones" it works fine, but when I have "Savatore Mattuciliogne, Belvedere Fredericks Wellington" it doesn't work so hot. Is there any way to basically dynamically scale the text in a given field based on the amount of content that's in that field? (The way Acrobat does this with PDF forms is exactly what I need.)
-
You just solved the problem. Thanks!
-
I have a printer that allows me to do zero-margin (edge to edge) printing. I can create an image in Photoshop that covers an entire 8.5x11 page and, when I print it, I get 100% of that layout. In FileMaker 9, not so much. When I set up a layout in FileMaker it isn't giving me a full 8.5x11 page. There's about 1/4" to 1/2" on all four sides. The Page Setup is correct; FileMaker simply won't let me do it. When I print out my page from FileMaker I get a white border around the edge of my page. This is unacceptable for what I need to do. If I go into Layout mode and go to View -> Page Margins it shows me what FileMaker THINKS are the page margins, but I'm unable to drag my Photoshop image past the margin area (into what FileMaker thinks is an unprintable area). Is there any way around this?
-
FWIW, I had lengthy discussions with Brother about printing from FileMaker. According to Brother they don't consider the P-Touch to be a "printer" but rather a "label maker", so they only support printing through the P-Touch application. This is a crock of you-know-what, of course, but the short of it is that Brother is not at all interested in allowing other applications to print to their P-Touch printers, and they design their software and drivers to reflect this.
-
I've only done 'passive' things with IWP, just reading information from a database. Never had people entering data from a web browser until now. At exactly what point does user input become part of the database? IOW, if you're working in FMP directly (not via IWP) and you enter data, it's pretty much instantly part of the database. If someone is on a web-enabled version of that page, does it work similarly? Is there a timeout or some other 'automatic' entering of the data? Basically I need to set up a system where a user can enter specific data (name, department, comments, etc) but I don't want that data to become part of the database until the user clicks a SUBMIT button. If the user enters data and then closes the browser window (without clicking SUBMIT), or if the user enters data and then walks away (leaving the browser window open for potentially hours at a time), I don't want that data to be entered into the database.
-
Thanks for confirming. Based on your suggestion I found a more simple solution. My "EMPTY" field now has a date in it of January 1, 2000, which is earlier than any conceivable date that would be entered in the "Nomination Date" or "Award Date" fields. I can then compare the values of those fields ("EMPTY < Award Date", for example) and since FM sees an empty field as the lowest possible value, then an empty "Award Date" field would be less than the date in my "EMPTY" field and would give me the result I need.
-
I'm trying to set up a self-defining portal and I'm having some difficulty. I have a table ("Recipients") which has a text field ("Name") and three date fields ("Nomination Date", "Award Date", and "EMPTY"). The "EMPTY" field is just that: empty, no data in it at all, and it is a global field. "Recipients" has two relationships defined. The first is with "Recipients 2" which relates "Name=Name". The second is with "Recipients 3" which relates "Name=Name" *and* "EMPTY≠Award Date". Portal #1 on my "Recipients" table points to my first relationship, thus giving me a list of all awards that a given person has been nominated for and/or received. This works fine. Portal #2 on my "Recipients" table points to my second relationship, thus giving me a list of ONLY awards that a given person has been nominated for. The condition of "EMPTY≠Award Date" would be the qualifier here; if "Award Date" is empty then the person hasn't received the award, therefore the person was nominated but did not win. The problem is portal #2 and my relationship with "Recipients 3" is not working properly UNLESS I put some data into the "EMPTY" field. Is there no way to establish a relationship based on the emptiness of a field?
-
I'm trying to build a "drill-down" system in FileMaker and I've run into a wall. Table "Fonts" has a portal pointing to table "Keywords", which in turn has a field called "Keyword Count" that, via a self-assigned relationship, counts how many times a given keyword is used. When I look at my layout in "Fonts" I see the keyword (e.g., "industrial") followed by a number; the number indicates how many fonts have this keyword attached to it. Any given font can have any number of keywords. That part works fine. I wrote a script that, when you click on a keyword in the "Fonts" layout, omits any fonts that don't have that keyword attached. That part also works fine. What I need to have happen is that number needs to dynamically change with the criteria. For example, let's say there are 200 fonts, of which 100 fonts have the keyword "industrial" and out of those 20 also have the keyword "deco". I first click "industrial" which reduces my found set to 100. I then click "deco" which reduces my found set to 20 - but the number next to "industrial" still reads 100. I need it to reflect not the total number of fonts with that keyword, but rather the total number of fonts with that keyword in the found set. I've been experimenting with all manner of calculations and it never quite works the way I need it to. What's the best way to get this done?
-
Probably, but the people using the database don't want it that way.
-
I have a table ("registrations") that has a number of fields, including a DATE field that's automatically populated with the creation date. When a new registration happens the current date is automatically populated there. I also have another table ("shows") that has a relationship to the "registrations" table based on the show ID number. As it is now, there are 55 registrations 'visible' from the "shows" table. What I need is, on the "shows" table, a list/breakdown of registrations by date. For example, let's say that there were 10 registrations per day for the past five days, plus five registrations today. What I need is a portal on the "shows" page that contains this information: 2/6/2009 10 2/7/2009 20 2/8/2009 30 2/9/2009 40 2/10/2009 50 2/11/2009 55 Like many things FileMaker this seems like it should be easy but I've been banging my head on it for a couple of days now and I'm no closer than I was before. How exactly can I get this done? Thanks.
-
Well, I found a workaround but I'd still like to know what's causing the lag. If I put a "Freeze Window" command at the top of my script, everything works perfectly and without the lag. I also added functions to my script which erase the "XML Body" field when it's done exporting which will avoid the lag if I were to enter that table while the data was still there.
-
I created a database to keep track of a couple hundred FTP accounts and it works well enough. I created a script in that database to generate an exported file that, with minimal tweaking, becomes an XML file that FileZilla can import as a bookmark list. (The "minimal tweaking" is basically doing a global search and replace in a text editor to insert line breaks, since FMP won't export a line break.) To accomplish this I created a new table with three fields: XML Header, XML Body, and XML Footer. There is only one record in this table and that record contains the XML header and footer information. The script I created is to fill in the body field with the information from the FTP accounts table. My script: Go to Layout ["Summary View" (FTP Accounts)] Show All Records Sort Records [Restore; No dialog] Go to Record/Request/Page [First] Loop Set Variable [$XMLexport; Value:$XMLexport & FTP Accounts::XML Export & ¶ Go to Record/Request/Page [Next, Exit after last] End Loop Go to Layout ["XML Export" (XML Export)] Insert Calculated Result [select; XML Export::XML Body; $XMLexport] The "FTP Accounts::XML Export" field is a calculation field that aggregates the FTP account information into a chunk of XML code for FileZilla. For example, if the FTP account information was: Account Name: My FTP Account Server: ftp.nowhere.com Username: anonymous Password: mypassword The "FTP Accounts::XML Export" field would turn that information into what FileZilla needs: ftp.nowhere.com 21 0 0 anonymous mypassword 1 0 MODE_DEFAULT 0 Auto 0 My FTP Account My FTP Account With that in mind, you can see what the script is doing. It puts the contents of "FTP Accounts::XML Export" into the $XMLexport variable, then appends "FTP Accounts::XML Export" from the next record to the end of it and proceeds down the line. Eventually the last record has been processed and $XMLexport contains all of the "FTP Accounts::XML Export" data. It then moves to the XML Export table and inserts the collected data into the "XML Export::XML Body" field. (The next step, which I haven't put into the script yet, would be to export that single record from the XML Export table which would contain my nearly-complete bookmarks file.) Here's where I run into the problem. The script runs quickly and smoothly while it collects all of the information, even with several hundred records. But when the script gets to "Insert Calculated Result" step, FM hangs for a VERY long time, as in several hours. Even if the script is processing only a handful of records - say, five or ten - there's a noticable hang of about five seconds during the "Insert Calculated Result" step. After FM recovers the data is in the field as needed but, for as long as you're in the "XML Export" table, FM is extremely laggy. Once you move into the "FTP Accounts" table the database runs as quickly and as smoothly as ever. Move back into "XML Export" and it's lag galore. Have I hit upon some limitation of FM? I have a completely unrelated database that has text fields which are holding dozens of pages of text and there's no lag whatsoever so I'm not sure where the problem lies. I've also tried using "Set Field" instead of "Insert Calculated Result" and got the same lagging issue. I've even tried not using a variable, having FM flip between the two tables to move the data one record at a time, but the lag still happens. Any ideas as to what's happening?
-
Thanks, but that's not exactly what I had in mind. The FMP file attached to that link is a table with ~150 predefined colors. I don't want ANY predefined colors; I want the user to be able to type in a hex color and have the "Sample" field change to that color.
-
Create a table with two text fields, "Color" and "Sample". Allow the user to enter a hex color (e.g., FF0000 for red, 00FF00 for green, etc) in the "Color" field, and have the fill color of the "Sample" field change to that color. Possible?
-
Unique calculation via a portal?
Steve G replied to Steve G's topic in Calculation Engine (Define Fields)
I posted my original question on another forum and got this response, in case anyone is having the same issue: I followed this very straightforward response and it works perfectly. I actually hid the calcShowBooth field behind a small graphic I have in the portal (for deleting the portal record) so it is literally invisible. So the answer is NOT, as comment says, to put calcShowBooth into the *layout* where the portal is, but to put calcShowBooth into the *portal* itself. That's an important distinction.