Jump to content

RobinDC

Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • Gender
    Male

RobinDC's Achievements

Rookie

Rookie (2/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Here is a little script I wrote to make new folders on a user's desktop. It gets the folder name as a script parameter, but you could probably pass a full path instead. I had to edit the AppleScript step using a Mac, and the VB Script 'Send Event' step in Windows, but once those are setup the rest is pretty easy. Make Folder on Desktop (param folderName - AppleScript, VB Script) ---- #This creates, but does not overwrite a folder. Tested on Win XP and Mac 10.6 using FM 11. Set Variable [ $FolderName; Value:GetValue ( Get ( ScriptParameter ) ; 1 ) ] If [ $FolderName = "" ] Exit Script [ Result: "Error - Empty folder name so no folder created." ] ElseIf[Abs(Get(SystemPlatform))=1 //Mac] Set Variable [ $FolderScript; Value:"tell application "Finder"¶try¶" & "make new folder at desktop with properties {name:"" & $FolderName & ""}¶end try¶end tell" ] Perform AppleScript [ Calculated AppleScript: $FolderScript ] Else #Drop the first slash and change forward slash to backslash in the Windows desktop path. Set Variable [ $FolderPath; Value:Substitute ( Right ( Get ( DesktopPath ) ; Length ( Get ( DesktopPath ) ) - 1 ) ; "/" ; "" ) & $FolderName ] Send Event [ open document; "cmd /c md "" & $FolderPath & """ // Quotes around the folder path allow spaces in the path.; Application Name: “<unknown>” ] #Commit step was added to fix a problem adding the first file into a folder failed because folder is not quite ready? Commit Records/Requests End If
  2. Hopefully, this post will help someone trying to integrate their solution with the BigCommerce API. FileMaker can update the status of an order on BigCommerce by sending a URL to this PHP, transforming a GET call URL to a PUT call for the BigCommerce API v2. The file is hosted on an internal server for security, and requires the cURL library. The key is the curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, "PUT"); line to change the normal POST process for adding data into a PUT process for changing data. <?php // Converts a GET encoded URL to PUT for BigCommerce API v2. -Rob Caldwell 3/2013 // Requires cURL library for PHP on the server. // Strongly recommend loading this file on a private internal server for data security. // Sample update calculation for FileMaker v10-12 = $php_file_location & "?data=" & Substitute ( GetAsURLEncoded ( "https://user:apikey@example.com/api/v2/orders/" & $web_order_id & "?<order><status_id>" & $new_order_status & "</status_id></order>" ) ; [ ":" ; "%3A" ] ) // XML response can be imported directly into FileMaker using an XML stylesheet (XSLT) like the one included in the examples with FileMaker software. // // You can check any existing order with this simple URL format: // "https://user:apikey@example.com/api/v2/orders/" & $web_order_id /* Authentication not needed if they are included in the url. $credentials = "user:apikey";*/ $headers = array( "Content-type: application/xml", //"Authorization: Basic " . base64_encode($credentials) ); $uri = isset($_GET['data']) ? $_GET['data'] : '' ; if ($uri == "") { echo "<html><head><title>Get to Put</title></head><body> <div style='text-align:center; padding: 50px 0px;'> <form method='get'> URL &nbsp;<input type='text' name='data' style='width: 50%'> <INPUT type='submit' value='Put to Update'> <form> <br /><br />" . htmlentities("Example - https://user:apikey@example.com/api/v2/orders/100?<order><status_id>10</status_id></order>") . " </div> </body></html>"; } else { // Get the current url and split it at the '?' $postArray = explode("?", $uri); $url = $postArray[0]; $args = $postArray[1]; $ch = curl_init($url); //open connection curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //optional, sends response to a variable curl_setopt($ch, CURLOPT_TIMEOUT, 60); //set to 60 seconds from BC API Guide v1 PDF example curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); //load all header data curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); //comment out this PUT line to change to a POST statement curl_setopt($ch, CURLOPT_POSTFIELDS, $args); $result = curl_exec($ch); //execute post curl_close($ch); //close connection // Quick and dirty output check - if result is XML, make it render nicely in browser if (strstr($result, "<?xml") && !strstr($result, "<error>")) header ("content-type: text/xml"); echo $result; //echo $uri; } ?>
  3. This is fantastic, and so simple. It worked for me on the first try. I couldn't believe it. Thank you.
  4. I know it sounds silly, it's really just an easy proof-of-concept. Of course, after a day of research, I figured it out 2 hours after my post. I was installing the fmjdbc.jar driver on my client machine, but not on the server. Once I loaded the .jar file into /Library/Java/Extensions the connection worked fine. This worked with my mini FMSA 11v3 test server, I'll still need to get it working on the Win 2003 FMSA 10 production machine, but that will be a different post I'm sure.
  5. I would like to connect FileMaker Pro Adv 11 client to FileMaker Server Adv 10 using JDBC. I've been using Pro 11 is a JDBC client to MySQL just fine. FMSA is configured to share ODBC & JDBC, and so is the file. I am using360Works JDBC plugin v1.74, and the 'JDBC Example.fp7' file from that plugin for testing. The 'fmjdbc.jar' driver is from the FileMaker 11 v2 dmg image, and loaded by the connection script from a container field. jdbcLoadDriver( "com.filemaker.jdbc.Driver" ; fmjdbc.jar ) jdbcOpenDatabase( "jdbc:filemaker://myfmserver:2399/mydatabase" ; username ; password ) The driver seems to load fine, but as soon as the script gets to the jdbcOpenDatabase step, the FileMaker client freezes. Several minutes later, I Force Quit and restart. Should I be using a different driver like DataDirect SequeLink from FileMaker 10? WooF seems a bit complicated to me. Perhaps there is a problem with my configuration commands. Insight and recommendations are greatly appreciated.
  6. Recently, I have been seeing an intermittent message: "XML parsing error: unable to connect socket for URL..." when importing jdbcXmlImportUrl on my Mac. Funny thing is, it only happens 2 out of 3 times. First attempt works, second and third attempts fail, then fourth try works again. Windows users are able to run the import script without a problem. I made this script about March 2010 and it worked fine for me then, so perhaps a plugin update changed the process? Has anyone else had this error? My Setup: Power Mac G5, OS 10.5.8, FileMaker 11 Adv, JDBC plugin 1.722, MySQL 4.0.21 data source with less than 700 rows. I also set the Heapspace to 128 with the file '~/Library/Application Support/FileMaker/Extensions/Saved/memorysize' because of some larger data projects.
  7. Thank you bcooney. Font differences between the platforms are an age old issue I've grown accustom to with every program (Word, Powerpoint, InDesign...). My concern is the shape of the page. I've attached a screen shot demonstrating the different page setups on each machine. Vaughan - Setting up different layouts is certainly a possibility. Currently, I have an IWP layout, printable layout, import layout and data entry layout. When a request comes in to change the form, all 4 layouts need to be updated. Since I'm not the only developer, it is hard for me to train others given the increasing complexity. I'm still hopeful it can work on one printable layout. I have found if I point both Mac & Win to the same printer, I can save the page setup and get the bottom edge of the page pretty close on both.
  8. I build some large forms in FM 10, some 3 pages, some 10 pages. Everything looks good on my Mac, both PDF and print have good page breaks. Now a Windows user clicks the button, the script takes the user to the layout, sets page setup and prints, but the page break on page one is off and gets worse with every page after. Scripting the page setup on one platform seems to mess it up for the other. Does anyone know of a page setup setting that would maintain page breaks when printed on both Mac and Windows? Thank you in advance.
  9. I discovered mine was due to a bad External Data Source.
×
×
  • Create New...

Important Information

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