Jump to content

uemtux

Members
  • Content Count

    75
  • Joined

  • Last visited

  • Days Won

    1

uemtux last won the day on January 25 2013

uemtux had the most liked content!

Community Reputation

1 Neutral

About uemtux

  • Rank
    Professional FM Guy for 5 Years

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. NOTE FOR FUTURE VIEWERS OF THIS THREAD: The script as-is may not work since as of FileMaker 12 GetAsText(containerField) returns more than just the filename. You may have to look for and remove additional text such as "remote:"
  2. Hi all, Here's another little tutorial I figured I'd share. The last one I posted on this part of the forum was how to upload the contents of a container field to an FTP server, using AppleScript to use the cURL command-line tool. This is similar to that, in that it uses AppleScript to invoke cURL, but this script allows you to use cuRL similarly to wget, to specify an URL and a destination path and have filemaker download that file to that path. To use this function specify your URL and Download Path (ex: "/Users/yourusername/Desktop/filename.zip") separated by ¶ in the script parameter. This will only work on Macs. It should work at the very least under MacOS 10.6-10.8 since I have confirmed that cURL comes packaged with the OS under those versions. -------------------------------------- curlDownload[$url, $unixpath] -------------------------------------- Set Variable [$url; Value:GetValue(Get(ScriptParameter) ; 1)] Set Variable [$url; Value:Substitute ( $url; "&" ; "" & "&" )] Set Variable [$url; Value:""" & Substitute ( $url; "&" ; "" & "&" ) & """] Set Variable [$unixpath; Value:GetValue(Get(ScriptParameter) ; 2)] Set Variable [$script; Value: "set curlscript to "curl "& $url & " > " & $unixpath & """ & "¶" & "set curlresult to do shell script curlscript"] Perform AppleScript [$script]
  3. Name & Parameters: HTMLEntities( text ; pointer ; store ) Description: Converts punctuation and symbols in 'text' to HTML entities, starting at position 'pointer' Set the 'store' parameter to "" - If you give it a value it will prefix your output with that value. Caution: This function will render inputted HTML non-functional. Since it will destroy the tags by replacing < and > with HTML entities. Recursive: Yes Sample Input: Hi, I'm some text with some symbols or punctuation to convert to HTML entities! ?&/Results: Hi&#44; I&#39;m some text with some symbols or punctuation to convert to HTML entities&#33; &#63;&#38;&#47;Formula: /* HTMLEntities Converts punctuation/symbol characters in text into HTML entities, starting at position pointer Free to use - attribution to my fmforums nickname would be nice uemtux Oct 10, 2013 */ Let( [ step = Middle(text ; pointer ; 1); step = Case( //step = " " ; "&#32;" ; // Uncomment to replace spaces with entity codes step = "!" ; "&#33;" ; step = """ ; "&#34;" ; step = "#" ; "&#35;" ; step = "$" ; "&#36;" ; step = "%" ; "&#37;" ; step = "&" ; "&#38;" ; step = "'" ; "&#39;" ; step = "(" ; "&#40;" ; step = ")" ; "&#41;" ; step = "*" ; "&#42;" ; step = "+" ; "&#43;" ; step = "," ; "&#44;" ; step = "-" ; "&#45;" ; step = "." ; "&#46;" ; step = "/" ; "&#47;" ; step = ":" ; "&#58;" ; step = ";" ; "&#59;" ; step = "<" ; "&#60;" ; step = "=" ; "&#61;" ; step = ">" ; "&#62;" ; step = "?" ; "&#63;" ; step = "@" ; "&#64;" ; step = "[" ; "&#91;" ; step = "" ; "&#92;" ; step = "]" ; "&#93;" ; step = "^" ; "&#94;" ; step = "_" ; "&#95;" ; step = "`" ; "&#96;" ; step = "{" ; "&#123;" ; step = "|" ; "&#124;" ; step = "}" ; "&#125;" ; step = "~" ; "&#126;" ; step); store = store & step; pointer = pointer + 1 ]; Case(pointer > Length(text) ; store ; HTMLEntities(text ; pointer ; store)) ) Required Functions: None. Credits: Got my info here: http://www.w3schools.com/tags/ref_ascii.asp Disclaimer: FM Forums does not endorse or warrantee these functions are fit for any particular purpose. Do not post or distribute files without written approval from the copyright owner. All files are deemed public domain unless otherwise indictated. Please backup every file that you intend to modify.
  4. Thanks for the answer. Could have done without the snark though, I did indeed run a search first but couldn't find what I was looking for.
  5. Hi guys, I've got a container field on my layout, completely unstyled, no fills or borders or anything. I've got "Reduce or Enlarge Image to Fit" selected and I have tried checking and unchecking "Maintain Original Proportions" no matter what I do there's a white border around the image within the confines of the container field. This border is not part of the image. I need the edge of the image flush with the edge of the field! Anyone run into this? Thanks.
  6. I will say only this... I have used FX.php in a production environment just once. I will never do it again. FX is just incredibly slow, especially when writing. These days, when I need PHP/Filemaker integration I accomplish it mainly by setting up MySQL servers and using the Actual Open Source Databases ODBC driver to create MySQL shadow tables in FileMaker. Both FileMaker and PHP can interact with MySQL with excellent speed, so it works well as a go-between.
  7. Hello, I have a set of records (Samples) to print. Many of the samples have a child record (Letters). I need to print the Samples from paper tray 1 and the Letters from paper tray 2, and I need to print all the records in order. Something like Sample/Letter/Sample/Sample/Sample/Letter - Each Sample, then the letter attached to that Sample, if present. So what do you guys think? Possible? Impossible? Needing a plugin? I'm looking for any ideas or suggestions you might have. Thanks
  8. Hi All, I just thought I'd try to give back to the community that has given so much to me by writing a little tutorial. This technique is one I developed on Macs. Mac OS X has the curl command line tool as part of the default installation. Curl is like a web swiss army knife. You can fetch files, POST data, upload to or download from FTP servers etc... so it brings a lot of functionality to the table which isn't built into FileMaker. I make use of curl through the "do shell script" AppleScript command, which in FileMaker I use through the "Perform AppleScript" script step. Here's a simple 6 line script that lets you take the contents of a container field and upload it to an FTP site. Substitute your container field in the first and fifth lines and your FTP information in the $script variable to make it functional. This script could be extended by actually having variables for the FTP credentials/location too but I've kept it simple here just to demonstrate the technique. set variable [$file_name; GetAsText(YourTable::YourContainerField)] set variable [$path_temp; Get(TemporaryPath) & $file_name] set variable [$path_unix; Middle($path_temp ; Position($path_temp ; "/" ; 1 ; 2) ; Length($path_temp))] set variable [$script; "do shell script "curl -T " & $path_unix & " ftp://USERNAME:PASSWORD@FTP_HOST/FTP_DIRECTORY/" & $file_name &"""] Export Field Contents [YourTable::YourContainerField; "$path_temp"] Perform AppleScript [$script] Enjoy!
  9. Nah, that wasn't it, I tried it both ways and it didn't work. The answer was that after the trigger is executed. filemaker does something else, it commits or leaves the field or something automatically, so the solution was just to put Exit Script[False] as my last line and prevent FM from doing that. Now it's working like a charm.
  10. Hi All, Â Got a weird problem for you today. I've got a global field on my layout, gScanSampleID, I use a barcode scanner to scan a value into it. The barcode scanner sends an 'Enter' keypress at the end of the scan, so I use the onObjectSave script trigger to run the script that does what I need to do with the scanned data. The only problem is, at the end of the script, I use a "Go to Field" to return to the gScanSampleID field, to make it ready for the user to scan again, but this isn't working! Â Nothing is selected, and I have to manually click into the field to scan again. Help? Screenshot of my script attached. Â Â
  11. Figured it out, here's how I did it: I made sure the relationship sort matched the portal sort. I used the List() function to load the list of shipping dates into a variable. I looped the List with GetValue to find the date closest to CurrentDate, then I just used my list pointer as my row number to go to, added a couple of rows so it'll scroll my desired record to the middle of the portal instead of it only showing on the last row.
  12. Hey All, At my company, we ship on twice weekly schedule. Therefore we usually know our shipping dates well in advance. Our shipping guy inputs the shipping dates into a FileMaker table so that the salesmen can assign their shipments to a particular Shipping ID, to ship their sale tomorrow or, if they like, next week or next month. So basically the "Shipping ID" table is 2 fields, shipDate and shipID. We've got past, present, and future dates in there. On a layout used by the shipping dept, I have a portal which lists all the ship dates in descending order by date. To see what's shipping for a particular Ship ID, the shipping guy scrolls to the ship date he's interested in and clicks on it in the portal. The shipping IDs closest to the current date are highlighted in yellow so they stand out. What I'd like to do is save the shipping guy a second or two by scrolling the portal to the active Shipping ID when he enters the layout... so... how would I go about figuring out which portal row to go to in the script step? I can't think of any way that doesn't involve switching layout and doing finds and sorts... Ideally I'd like the OnLayoutEnter triggered script to quickly locate the row and go to it without needing to leave the layout. Any ideas? Thanks
  13. Hello Everyone, I'm trying to write a database to run reports on apache logs. Does anyone have a tried, tested, and true way of splitting an apache log line into its constituent parts? I've found a few Perl regexes that do the job, so I can always use Applescript to do shell script and write a little perl program that splits all the 'fields' of the log onto separate lines for interpretation by FileMaker, but if anyone knows of a FileMaker native implementation of apache log parsing I'd love to know! Here is a sample apache log line if anyone needs (IPs Xed out): XXX.XXX.XXX.XXX - - [05/Aug/2012:23:57:39 -0400] "GET /SpryAssets/SpryMenuBarVertical.css HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible;)" XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX Thanks!
  14. Hi all, I'm making a 'catalog' database. The user basically picks a few products from a list and then gets a fancy printout showing pictures of the product on the left and a description on the right. The "picture" part is a web viewer which loads the product image off the company website. In some cases however, the image for the product is not online, it is however available in an internal database, in a container field. What I had intended to do was put a transparent container field on top of the web viewer, so that if no image was in the container you'd see the web viewer, and if an image was in the container the container would simply block out the web viewer. Unfortunately, it appears that while you can move a web viewer back and forward through the layers of a layout and put it behind other things, in browse mode the web viewer will always appear on top of everything overlapping it. Is there any way around this?
  15. It was indeed a problem with my script, which I finally caught. Sorry to start a topic needlessly!
×
×
  • Create New...

Important Information

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