Auto-fill FedEx forms in Safari via AppleScript
Thu, Feb 14 2008 at 7:30AM PST • Contributed by: ClarkGoble
Thu, Feb 14 2008 at 7:30AM PST • Contributed by: ClarkGoble
If you do a lot of shipping with FedEx, you know how annoying it is to cut and paste all the address information into Safari. There are expensive programs that will extract information, but most don't work with OS X or require Filemaker. Here's a quick hint I use quite often to autofill the FedEx forms.
You can easily modify this to do more programmically. For instance, I use Python and appscript to parse the emails my e-commerce solution sends, and then fill in the FedEx page with Safari. I'll leave that up to you. Even if you don't need to do that, simply autofilling most of the common fields may be a huge timesaver for you. This also demonstrates an easy way to handle forms in general.
The only bit that needs explanation is the filling in of the field shipmentDimension, which seems a tad confusing. FedEx adds a unique number for each custom box you've created. Go to Safari's View » View Source menu, search for shipmentDimension, and you'll see your custom box sizes and the numbers for each.
Also note the two delay statements which wait two seconds each. That is necessary so that FedEx's custom Javascript code runs. If you have a slow connection, you may need to increase that delay time.
The only bit that needs explanation is the filling in of the field shipmentDimension, which seems a tad confusing. FedEx adds a unique number for each custom box you've created. Go to Safari's View » View Source menu, search for shipmentDimension, and you'll see your custom box sizes and the numbers for each.
Also note the two delay statements which wait two seconds each. That is necessary so that FedEx's custom Javascript code runs. If you have a slow connection, you may need to increase that delay time.
•
[10,074 views]
