Jump to content

rcorbitt

Members
  • Content Count

    29
  • Joined

  • Last visited

Community Reputation

0 Neutral

About rcorbitt

  • Rank
    member
  • Birthday 07/28/1966
  1. I have a products database containing a "link" (text field) to a specific product on our website. At the end of a customer service phone call, I would like to be able to click a button and have the contents of an email message from three other (text) fields and the "link" copied to the clipboard. This information has to be pasted into another application, which sends the message, and records the notes of the customer service call. I cannot send the message from FileMaker, it has to be copied and pasted ... The problem lies in making the "link" field into a working URL. Currently the product link is saved as text in a field. The email format is divided into three text fields: ("Thanks ... item:"); ("If you ... Regards,"); and ("Rick" - the rep's name). I have created a calculation field that combines everything, but the web link is not clickable when pasted into the other application. Ideally, the product's name would be clickable, opening the "link" field info in a browser, without showing the URL. Any suggestions? Could this be done with an Applescript? We are only using iMac computers, running Yosemite (10.10.5). Everyone will be upgraded to El Capitan as soon as it releases. Thanks in advance for any help! Rick *********************************************** Message format: Thanks for contacting customer support today. Based on the reason your call, we feel you would be interested in this item: Widget 1000 (http://www.website.com/product_id?10000) If you have any questions, or would like to place an order, please contact me. Regards, Rick
  2. This will definitely work. Is it possible to write a script that will delete all the text "above" the string that begins with "Vendor:"? (All the records have the first four lines in the field.) Here's a better example:
  3. I'm having a foggy brain moment ... I have a text field that I would like to delete all the text in the first 18 lines, for over 7,000 records. The field contains a Product description, product ID, UPC and vendor record. I have each of these in separate fields. The text files were imported (originally Windows XP Notepad) as .txt files. Can someone point me in the right direction? Data example:
  4. Would it be possible to set the size of the body part using a calculated Applescript based on the case statement?
  5. I am generating a PDF from records in the found set. My layout has header, body, and footer parts. The page size is 11" x 15" with .5" margins on all sides. (Custom page size) The header is 1", the footer is .5"; both containing text. Is there a way to have the body records equally spaced, with a rule above and below, to fill the 12.5" available space? (There will never be more than 20 records in the body space.) Initially, I measured the size (in points) of a record including leading and created a "space" field that was placed above and below the data. Using a Case statement to count the number of records, I attempted to format the point size of the space field. This did not work, as FM won't accept 3.64 point text or similar. Is there a way to set the size of a part based on a calculation? Suggestions? Thanks in advance for any help.
  6. First, let me say thank you for all the help. I'm very grateful for all the suggestions. Second, I am not experienced with Applescript. My goal using AS with this database was to reformat text "after" it had been exported from FileMaker. Fenton's suggestion to use the Substitute() function is a good one, and I will probably include it once we're done with some beta testing ... The script that I posted was not complete. It was only to illustrate that I was using more than a simple AS statement or two. After fighting with FM for a few days, I have given up on running a native AS from FM and created a droplet. I would welcome any reference to how FileMaker runs Applescript. Or why scripts that run fine in Script Editor or Script Debugger, fail in FM. I'm sure this is a matter of syntax, but I couldn't find any kind of resource ... The droplet removes quote marks, commas, etc ... that are present in the exported FM text. I found a couple of canned solutions that use AS and a scriptable text editor to reformat text, again outside of FileMaker Pro. I chose to use Applescript rather than depending on another application, that is not "native" to the Mac OS, for editing. For those playing the home game on this thread, the answer to the original question is: --[original script] set theCounty to cell g_CorpCounty of database 1 --gets error -2753 in FM --[corrected script] set theData to get the cellValue of cell "fieldName" of layout "layoutName" of document "FileMaker Document" The mistake causing the error was due to my failing to enclose the "cell" and the "database name" in quotes. Ironically, I scrapped the AS to get the FM data, and included the info I needed in the output name of the file. The droplet, using AS delimiters, gets what it needs from the filename. Thanks again for all your help!
  7. Thanks, but as I understand it, this will only work on data in the fields. To complete the project, I still need to manipulate the exported text, outside of FileMaker. That's why I'm using the Applescript...
  8. First, there's not much relational data in this db. I created it to handle, format, and manage imported text. (I'm better with FM Pro than Applescript, and this way we have an easily searchable record of all the info.) I'm using the text that is being exported for a Quark XPress document. There are about 2,000-8,000 records each month that get exported. Formatting this large amount of data is only feasible using Quark tags or a plug-in like Xtags. I'm using .csv format for the export, so the records have to be cleaned and formatted with Quark Style Tags. I could do some of this with a calc field that uses the Substitute() function, but the Applescript seemed faster as the most important formatting occurs after the data has been exported from FileMaker. I suppose that I could save the Applescript code in FM globals and use a calculated script to call them. But I think fields in FM Pro are limited to 255 characters, so I'd need a bunch of globals to handle the entire script. I'll probably just use an Applescript step that asks the user for the g_County field value ...
  9. Actually, I'm using the whol eApplescript for more than just this field. tell (get (current date) - 30 * days) set currentMonth to (month of it) set currentYear to (year of it) set lastMonth to ("- " & currentMonth & " " & currentYear) as string end tell set theExportedText to (path to desktop as Unicode text) & " county final.xtg" as alias set theExportedText to (open for access file thePath with write permission) --Read the whole file at once because it is a small one set FileData to (open for access file theExportedText) set c0 to {""<@FTRCorpName>",", ""<@FTRCorpName>""} set c1 to {""<@FTRCorpAddress>",", ""<@FTRCorpAddress>""} set c2 to {" Dba ", " D/B/A "} set c3 to {" D/b/a ", " D/B/A "} set c4 to {",AL,", " AL,"} set c5 to {",GA,", " GA,"} set c6 to {",NC,", " NC,"} set c7 to {",FL,", " FL,"} set c8 to {",SC,", " SC,"} set c9 to {",TN,", " TN,"} set c10 to {",NC,", " NC,"} set c11 to {""", ""} set c12 to {", Inc.,", " Inc.,"} set c13 to {", LLC,", " LLC,"} set c14 to {"L.L.C.,", " LLC,"} set c15 to {", PLLC,", " PLLC,"} set c16 to {"L.L.C,", "LLC,"} set c17 to {", ,", ","} set c18 to {",", ", "} set ThingsToCleanOut to {c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18} repeat with aCleanUpPair in ThingsToCleanOut --grab the stuff to search and replace for set TextToFind to item 1 of aCleanUpPair set TextToReplace to item 2 of aCleanUpPair end repeat --Create The File and set the Creator Type set QuarkTags to "@Normal= @BusLicCompany= @FTRCorpName= @Normal=[s"","Normal"]<*J*h"Standard"*kn0*kt0*ra0*rb0*d0*p(0,9,0,0,0,0,g)Ps100p100t0h89.999z10k0b0cKf"StoneSerif"n0oG0> @BusLicAddress=[s"Normal","BusLicAddress"]<*ktA*ra0*rb0*p(0,0,0,0,0,2.88,g)*t(292.5,0,"1 ")Ps100p100t0h89.999z10k0b0cKf"NewsGothic"n0oG0> @FTRCorpAddress=[s"","FTRCorpAddress"]<*J*h"Standard"*kn0*kt0*ra0*rb0*d0*p(0,0,0,0,0,0,g)Ps100p100t0h89.999z9k0b0cKf"NewsGothic"n254oG0> @BusLicAddress:<*L*kt0*ra0*p(0,0,0,9.7,0,8.856,g)><*t(265.5,0,"1 "445.5,0,"1 "553.5,0,"1 "657,0,"1 "729,0,"1 ")> <*t(265.5,0,"1 "445.5,0,"1 "553.5,0,"1 "657,0,"1 "729,0,"1 ")>" & theCounty & " County - " & lastMonth & " @FTRCorpAddress:<*t(512,2,"1 "20736.457,0,"1 "27392.344,0,"" as text end tell application "Finder" set creator type of alias FinalFile to "XPR3" set file type of alias FinalFile to "TEXT" end tell There's a little more after this but you get the idea. I need "theCounty" for use in the name, and in some of the text that's written to the "formatted" file.
  10. This isn't working. I get the same error. The purpose of this AS statement is to get the value stored in the global field g_CorpCounty. This field is entered by the FM user when searching for records to be exported. I want to set it to an Applescript value (object?) so that I can use it again later in the Applescript to name the file. (set theOutputName to theCounty & " County final.txt")
  11. I'm having trouble getting data from a global field into an Applescript. Here's what I have now. tell application "FileMaker Pro" to set theCounty to cell g_CorpCounty of database 1 The script keeps giving me an error "theCounty" is not defined. Unknown error -2753. I've read that adding a try statement helps native Applescripts in FileMaker, but it hasn't prevented to error so far.
  12. Works great. Thanks. I guess that I'll not worry about the text editor. (I am using Tex-Edit Plus.)
  13. I need help with two things. First, I want a script that defines the output path for an exported text file. If possible, I want the user to select the output folder/location (example: MacHD:Users:User:Desktop:$filename.txt) on the first use of the script, and then the script will remember it each time the script runs. If the folder/location is missing, the script will ask the user to redefine it. Second, this exported text file will be imported into Quark XPress 7.2. Currently, I'm using Tex-Edit to "massage" the data to remove quote marks, commas, add spaces, etc. Can Applescript edit text without the use of a text editor application? Can somebody provide a sample of the code? (Otherwise, the FM database becomes dependent on a working text editor application. If the FM database were to ever moves, the script would stop working.) Thanks!
  14. Maybe a better solution would be just first and last name. Suggestions?
  15. THANKS! This works pretty well but ... The fourth "word" of the field will always be the suffix, if it exists; and I need to move it to the end. (BTW - Universal Capitalizer is incredible, I have it working on the address field already.) Currently "Doe, John Robert Sr." becomes "John Robert Sr. Doe". How do I get the fourth word to the end, only if it exists? "John Robert Doe Sr."
×
×
  • Create New...

Important Information

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