Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save a PDF as a serializing number
#1
I can't figure out how to word this for a Google search, so thought I'd ask the Automator gurus here. One of my tasks at work is to place anywhere from 10-50 orders for a particular part at the end of each day. Instead of wasting that much paper and ink, I save the confirmations as PDFs and place them on a server for all to view. Now, each of these PDFs have a particular 5-digit part number that is unique to our system. I could copy and paste, I could retype, but since the number is there on every page already, is there any way to get Automator or something similar to pull that number and save the file under that? Since Leopard is very good about indexing PDFs, it doesn't really matter for me as I can find each one rather quickly through Spotlight. However, I'm the only Mac user. Everyone else just sees the serialized numbers (1...2...3) under the folder date (122108). Any ideas?
Reply
#2
I don't know how to do it, but what you could do is to save each PDF as a date-time file, for example 2008-12-21-19-26-30.pdf, that would be today's date at 7:26 PM (and 30 seconds). If there is at least 1 second between those orders, the files should not overlap. This can be done in Automator, you could even replace the "Save PDF to Web Receipts" plug in to do exactly this.

would that work?
Reply
#3
That unfortunately doesn't help the PC users wanting to pull the .PDF based on the five-digit number (our internal house number).
Reply
#4
What app is creating the PDF files?
Reply
#5
Firefox. File>print>save as PDF
Reply
#6
Saving PDFs from FireFox in that manner gets the file name from the HTML document's tag. All you need is a Greasmonkey script or a bookmarklet that changes the title on the fly. I'm guessing the part # is part of the url's query string or resides in a javascript-accessible node within the document. It's probably trivial to do. </div> <div class="post_meta" id="post_meta_858188"> <div class="float_right"> </div> </div> </div> <div class="post_controls"> <div class="postbit_buttons author_buttons float_left"> <!-- start: postbit_find --> <a href="search.php?action=finduser&uid=39" title="Find all posts by this user" class="postbit_find"><span>Find</span></a> <!-- end: postbit_find --> </div> <div class="postbit_buttons post_management_buttons float_right"> <!-- start: postbit_quote --> <a href="newreply.php?tid=68813&replyto=858188" title="Quote this message in a reply" class="postbit_quote postbit_mirage"><span>Reply</span></a> <!-- end: postbit_quote --> </div> </div> </div> <!-- end: postbit --><!-- start: postbit --> <a name="pid858230" id="pid858230"></a> <div class="post " style="" id="post_858230"> <div class="post_author"> <!-- start: postbit_avatar --> <div class="author_avatar"><a href="member.php?action=profile&uid=108"><img src="https://forums.macresource.com/images/default_avatar.png" alt="" width="55" height="55" /></a></div> <!-- end: postbit_avatar --> <div class="author_information"> <strong><span class="largetext"><a href="https://forums.macresource.com/member.php?action=profile&uid=108">blusubaru</a></span></strong> <!-- start: postbit_offline --> <img src="https://forums.macresource.com/images/buddy_offline.png" title="Offline" alt="Offline" class="buddy_status" /> <!-- end: postbit_offline --><br /> <span class="smalltext"> Posting Freak<br /> <img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><br /> </span> </div> <div class="author_statistics"> <!-- start: postbit_author_user --> Posts: 5,446<br /> Threads: 696<br /> Joined: May 2013 <!-- start: postbit_reputation --> <br />Reputation: <!-- start: postbit_reputation_formatted_link --> <a href="reputation.php?uid=108"><strong class="reputation_neutral">0</strong></a> <!-- end: postbit_reputation_formatted_link --> <!-- end: postbit_reputation --> <!-- end: postbit_author_user --> </div> </div> <div class="post_content"> <div class="post_head"> <!-- start: postbit_posturl --> <div class="float_right" style="vertical-align: top"> <strong><a href="showthread.php?tid=68813&pid=858230#pid858230" title="Re: Save a PDF as a serializing number">#7</a></strong> </div> <!-- end: postbit_posturl --> <span class="post_date">12-22-2008, 03:15 AM <span class="post_edit" id="edited_by_858230"></span></span> </div> <div class="post_body scaleimages" id="pid_858230"> Hmm... coding is not my thing! But yes, the title of the document comes from the header of the page. It's the same for each one, the title of the vendor. I just add a 1, 2, 3... to the end of the title to save multiple PDF's in one folder. If I could get the default to save as the house number instead, that would be stellar. <br /> <br /> It looks like there is an identifiable part of the page source that determines the house number. Here's a snippet: <br /> "input type="hidden" name="part_no" value="888888" <br /> where 888888 is a test house number. It appears in five total places, and is entered up to two different places on the ordering page. </div> <div class="post_meta" id="post_meta_858230"> <div class="float_right"> </div> </div> </div> <div class="post_controls"> <div class="postbit_buttons author_buttons float_left"> <!-- start: postbit_find --> <a href="search.php?action=finduser&uid=108" title="Find all posts by this user" class="postbit_find"><span>Find</span></a> <!-- end: postbit_find --> </div> <div class="postbit_buttons post_management_buttons float_right"> <!-- start: postbit_quote --> <a href="newreply.php?tid=68813&replyto=858230" title="Quote this message in a reply" class="postbit_quote postbit_mirage"><span>Reply</span></a> <!-- end: postbit_quote --> </div> </div> </div> <!-- end: postbit --><!-- start: postbit --> <a name="pid858251" id="pid858251"></a> <div class="post " style="" id="post_858251"> <div class="post_author"> <!-- start: postbit_avatar --> <div class="author_avatar"><a href="member.php?action=profile&uid=39"><img src="https://forums.macresource.com/images/default_avatar.png" alt="" width="55" height="55" /></a></div> <!-- end: postbit_avatar --> <div class="author_information"> <strong><span class="largetext"><a href="https://forums.macresource.com/member.php?action=profile&uid=39">Seacrest</a></span></strong> <!-- start: postbit_offline --> <img src="https://forums.macresource.com/images/buddy_offline.png" title="Offline" alt="Offline" class="buddy_status" /> <!-- end: postbit_offline --><br /> <span class="smalltext"> Posting Freak<br /> <img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><br /> </span> </div> <div class="author_statistics"> <!-- start: postbit_author_user --> Posts: 13,726<br /> Threads: 599<br /> Joined: Nov 2024 <!-- start: postbit_reputation --> <br />Reputation: <!-- start: postbit_reputation_formatted_link --> <a href="reputation.php?uid=39"><strong class="reputation_neutral">0</strong></a> <!-- end: postbit_reputation_formatted_link --> <!-- end: postbit_reputation --> <!-- end: postbit_author_user --> </div> </div> <div class="post_content"> <div class="post_head"> <!-- start: postbit_posturl --> <div class="float_right" style="vertical-align: top"> <strong><a href="showthread.php?tid=68813&pid=858251#pid858251" title="Re: Save a PDF as a serializing number">#8</a></strong> </div> <!-- end: postbit_posturl --> <span class="post_date">12-22-2008, 03:41 AM <span class="post_edit" id="edited_by_858251"></span></span> </div> <div class="post_body scaleimages" id="pid_858251"> <pre class="code"> j‌avascript: (function(){document.title=document.forms[0].part_no.value;window.print()})();<br /> </pre>*<br /> <br /> If there's only one form on the page, this should work.<br /> Create a new bookmark, and set this as the URL.<br /> When you want to print the page, choose that bookmark.<br /> <br /> <br /> If there is more than on form on the page, you're going to have to figure out which form element contains 'part_no.'<br /> <br /> *you'll need to get rid of the space between 'j‌avascript:' and the first '('. </div> <div class="post_meta" id="post_meta_858251"> <div class="float_right"> </div> </div> </div> <div class="post_controls"> <div class="postbit_buttons author_buttons float_left"> <!-- start: postbit_find --> <a href="search.php?action=finduser&uid=39" title="Find all posts by this user" class="postbit_find"><span>Find</span></a> <!-- end: postbit_find --> </div> <div class="postbit_buttons post_management_buttons float_right"> <!-- start: postbit_quote --> <a href="newreply.php?tid=68813&replyto=858251" title="Quote this message in a reply" class="postbit_quote postbit_mirage"><span>Reply</span></a> <!-- end: postbit_quote --> </div> </div> </div> <!-- end: postbit --><!-- start: postbit --> <a name="pid858423" id="pid858423"></a> <div class="post " style="" id="post_858423"> <div class="post_author"> <!-- start: postbit_avatar --> <div class="author_avatar"><a href="member.php?action=profile&uid=108"><img src="https://forums.macresource.com/images/default_avatar.png" alt="" width="55" height="55" /></a></div> <!-- end: postbit_avatar --> <div class="author_information"> <strong><span class="largetext"><a href="https://forums.macresource.com/member.php?action=profile&uid=108">blusubaru</a></span></strong> <!-- start: postbit_offline --> <img src="https://forums.macresource.com/images/buddy_offline.png" title="Offline" alt="Offline" class="buddy_status" /> <!-- end: postbit_offline --><br /> <span class="smalltext"> Posting Freak<br /> <img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><br /> </span> </div> <div class="author_statistics"> <!-- start: postbit_author_user --> Posts: 5,446<br /> Threads: 696<br /> Joined: May 2013 <!-- start: postbit_reputation --> <br />Reputation: <!-- start: postbit_reputation_formatted_link --> <a href="reputation.php?uid=108"><strong class="reputation_neutral">0</strong></a> <!-- end: postbit_reputation_formatted_link --> <!-- end: postbit_reputation --> <!-- end: postbit_author_user --> </div> </div> <div class="post_content"> <div class="post_head"> <!-- start: postbit_posturl --> <div class="float_right" style="vertical-align: top"> <strong><a href="showthread.php?tid=68813&pid=858423#pid858423" title="Re: Save a PDF as a serializing number">#9</a></strong> </div> <!-- end: postbit_posturl --> <span class="post_date">12-22-2008, 03:19 PM <span class="post_edit" id="edited_by_858423"></span></span> </div> <div class="post_body scaleimages" id="pid_858423"> OMG! You freaking rock! Thank you so much! </div> <div class="post_meta" id="post_meta_858423"> <div class="float_right"> </div> </div> </div> <div class="post_controls"> <div class="postbit_buttons author_buttons float_left"> <!-- start: postbit_find --> <a href="search.php?action=finduser&uid=108" title="Find all posts by this user" class="postbit_find"><span>Find</span></a> <!-- end: postbit_find --> </div> <div class="postbit_buttons post_management_buttons float_right"> <!-- start: postbit_quote --> <a href="newreply.php?tid=68813&replyto=858423" title="Quote this message in a reply" class="postbit_quote postbit_mirage"><span>Reply</span></a> <!-- end: postbit_quote --> </div> </div> </div> <!-- end: postbit --><!-- start: postbit --> <a name="pid858459" id="pid858459"></a> <div class="post " style="" id="post_858459"> <div class="post_author"> <!-- start: postbit_avatar --> <div class="author_avatar"><a href="member.php?action=profile&uid=877"><img src="https://forums.macresource.com/images/default_avatar.png" alt="" width="55" height="55" /></a></div> <!-- end: postbit_avatar --> <div class="author_information"> <strong><span class="largetext"><a href="https://forums.macresource.com/member.php?action=profile&uid=877">space-time</a></span></strong> <!-- start: postbit_offline --> <img src="https://forums.macresource.com/images/buddy_offline.png" title="Offline" alt="Offline" class="buddy_status" /> <!-- end: postbit_offline --><br /> <span class="smalltext"> Posting Freak<br /> <img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><br /> </span> </div> <div class="author_statistics"> <!-- start: postbit_author_user --> Posts: 48,066<br /> Threads: 9,823<br /> Joined: Dec 2021 <!-- start: postbit_reputation --> <br />Reputation: <!-- start: postbit_reputation_formatted_link --> <a href="reputation.php?uid=877"><strong class="reputation_neutral">0</strong></a> <!-- end: postbit_reputation_formatted_link --> <!-- end: postbit_reputation --> <!-- end: postbit_author_user --> </div> </div> <div class="post_content"> <div class="post_head"> <!-- start: postbit_posturl --> <div class="float_right" style="vertical-align: top"> <strong><a href="showthread.php?tid=68813&pid=858459#pid858459" title="Re: Save a PDF as a serializing number">#10</a></strong> </div> <!-- end: postbit_posturl --> <span class="post_date">12-22-2008, 04:12 PM <span class="post_edit" id="edited_by_858459"></span></span> </div> <div class="post_body scaleimages" id="pid_858459"> so did you install greasemonkey, or you just put this bookmark? </div> <div class="post_meta" id="post_meta_858459"> <div class="float_right"> </div> </div> </div> <div class="post_controls"> <div class="postbit_buttons author_buttons float_left"> <!-- start: postbit_find --> <a href="search.php?action=finduser&uid=877" title="Find all posts by this user" class="postbit_find"><span>Find</span></a> <!-- end: postbit_find --> </div> <div class="postbit_buttons post_management_buttons float_right"> <!-- start: postbit_quote --> <a href="newreply.php?tid=68813&replyto=858459" title="Quote this message in a reply" class="postbit_quote postbit_mirage"><span>Reply</span></a> <!-- end: postbit_quote --> </div> </div> </div> <!-- end: postbit --> </div> </td></tr> <tr> <td class="tfoot"> <!-- start: showthread_search --> <div class="float_right"> <form action="search.php" method="post"> <input type="hidden" name="action" value="thread" /> <input type="hidden" name="tid" value="68813" /> <input type="text" name="keywords" value="Enter Keywords" onfocus="if(this.value == 'Enter Keywords') { this.value = ''; }" onblur="if(this.value=='') { this.value='Enter Keywords'; }" class="textbox" size="25" /> <input type="submit" class="button" value="Search Thread" /> </form> </div> <!-- end: showthread_search --> <div> <strong>« <a href="showthread.php?tid=68813&action=nextoldest">Next Oldest</a> | <a href="showthread.php?tid=68813&action=nextnewest">Next Newest</a> »</strong> </div> </td> </tr> </table> <div class="float_left"> <!-- start: multipage --> <div class="pagination"> <span class="pages">Pages (2):</span> <!-- start: multipage_page_current --> <span class="pagination_current">1</span> <!-- end: multipage_page_current --><!-- start: multipage_page --> <a href="showthread.php?tid=68813&page=2" class="pagination_page">2</a> <!-- end: multipage_page --><!-- start: multipage_nextpage --> <a href="showthread.php?tid=68813&page=2" class="pagination_next">Next »</a> <!-- end: multipage_nextpage --> </div> <!-- end: multipage --> </div> <div style="padding-top: 4px;" class="float_right"> </div> <br class="clear" /> <br /> <div class="float_left"> <ul class="thread_tools"> <!-- start: showthread_printthread --> <li class="printable"><a href="printthread.php?tid=68813">View a Printable Version</a></li> <!-- end: showthread_printthread --> </ul> </div> <div class="float_right" style="text-align: right;"> <!-- start: forumjump_advanced --> <form action="forumdisplay.php" method="get"> <span class="smalltext"><strong>Forum Jump:</strong></span> <select name="fid" class="forumjump"> <option value="-4">Private Messages</option> <option value="-3">User Control Panel</option> <option value="-5">Who's Online</option> <option value="-2">Search</option> <option value="-1">Forum Home</option> <!-- start: forumjump_bit --> <option value="1" > My Category</option> <!-- end: forumjump_bit --><!-- start: forumjump_bit --> <option value="3" selected="selected">-- Tips and Deals</option> <!-- end: forumjump_bit --><!-- start: forumjump_bit --> <option value="4" >-- For Sale & Free Items</option> <!-- end: forumjump_bit --><!-- start: forumjump_bit --> <option value="5" >-- For Sale & Free Items Archive</option> <!-- end: forumjump_bit --><!-- start: forumjump_bit --> <option value="6" >-- 'Friendly' Political Ranting</option> <!-- end: forumjump_bit --> </select> <!-- start: gobutton --> <input type="submit" class="button" value="Go" /> <!-- end: gobutton --> </form> <script type="text/javascript"> $(".forumjump").on('change', function() { var option = $(this).val(); if(option < 0) { window.location = 'forumdisplay.php?fid='+option; } else { window.location = 'forumdisplay.php?fid='+option; } }); </script> <!-- end: forumjump_advanced --> </div> <br class="clear" /> <!-- start: showthread_usersbrowsing --> <br /> <span class="smalltext">Users browsing this thread: 1 Guest(s)</span> <br /> <!-- end: showthread_usersbrowsing --> <!-- start: footer --> </div> </div> <div id="footer"> <div class="upper"> <div class="wrapper"> <ul class="menu bottom_links"> <!-- start: footer_showteamlink --> <li><a href="showteam.php">Forum Team</a></li> <!-- end: footer_showteamlink --> <!-- start: footer_contactus --> <li><a href="https://forums.macresource.com/contact.php">Contact Us</a></li> <!-- end: footer_contactus --> <li><a href="https://forums.macresource.com">MacResource Forum</a></li> <li><a href="#top">Return to Top</a></li> <li><a href="https://forums.macresource.com/archive/index.php?thread-68813.html">Lite (Archive) Mode</a></li> <li><a href="https://forums.macresource.com/misc.php?action=markread">Mark all forums read</a></li> <li><a href="https://forums.macresource.com/misc.php?action=syndication">RSS Syndication</a></li> </ul> </div> </div> <div class="lower"> <div class="wrapper"> <span id="current_time"><strong>Current time:</strong> 07-08-2025, 10:57 PM</span> <span id="copyright"> <!-- MyBB is free software developed and maintained by a volunteer community. It would be much appreciated by the MyBB Group if you left the full copyright and "powered by" notice intact, to show your support for MyBB. If you choose to remove or modify the copyright below, you may be refused support on the MyBB Community Forums. This is free software, support us and we'll support you. --> Powered By <a href="https://mybb.com" target="_blank" rel="noopener">MyBB</a>, © 2002-2025 <a href="https://mybb.com" target="_blank" rel="noopener">MyBB Group</a>. <!-- End powered by --> </span> </div> </div> </div> <!-- The following piece of code allows MyBB to run scheduled tasks. DO NOT REMOVE --><!-- End task image code --> </div> <!-- end: footer --> <script type="text/javascript"> var thread_deleted = "0"; if(thread_deleted == "1") { $("#quick_reply_form, .new_reply_button, .thread_tools, .inline_rating").hide(); $("#moderator_options_selector option.option_mirage").attr("disabled","disabled"); } </script> <script><!-- var ct_checkjs_val = 'dd51df252dab43b61849446539dc9759', d = new Date(), ctTimeMs = new Date().getTime(), ctMouseEventTimerFlag = true, //Reading interval flag ctMouseData = "[", ctMouseDataCounter = 0; function ctSetCookie(c_name, value) { document.cookie = c_name + "=" + escape(value) + "; path=/;"; } ctSetCookie("ct_checkjs", ct_checkjs_val); ctSetCookie("ct_ps_timestamp", Math.floor(new Date().getTime()/1000)); ctSetCookie("ct_fkp_timestamp", "0"); ctSetCookie("ct_pointer_data", "0"); ctSetCookie("ct_timezone", "0"); setTimeout(function(){ ctSetCookie("ct_timezone", d.getTimezoneOffset()/60*(-1)); },1000); //Reading interval var ctMouseReadInterval = setInterval(function(){ ctMouseEventTimerFlag = true; }, 150); //Writting interval var ctMouseWriteDataInterval = setInterval(function(){ var ctMouseDataToSend = ctMouseData.slice(0,-1).concat("]"); ctSetCookie("ct_pointer_data", ctMouseDataToSend); }, 1200); //Stop observing function function ctMouseStopData(){ if(typeof window.addEventListener == "function") window.removeEventListener("mousemove", ctFunctionMouseMove); else window.detachEvent("onmousemove", ctFunctionMouseMove); clearInterval(ctMouseReadInterval); clearInterval(ctMouseWriteDataInterval); } //Logging mouse position each 300 ms var ctFunctionMouseMove = function output(event){ if(ctMouseEventTimerFlag === true){ var mouseDate = new Date(); ctMouseData += "[" + Math.round(event.pageY) + "," + Math.round(event.pageX) + "," + Math.round(mouseDate.getTime() - ctTimeMs) + "],"; ctMouseDataCounter++; ctMouseEventTimerFlag = false; if(ctMouseDataCounter >= 100) ctMouseStopData(); } }; //Stop key listening function function ctKeyStopStopListening(){ if(typeof window.addEventListener == "function"){ window.removeEventListener("mousedown", ctFunctionFirstKey); window.removeEventListener("keydown", ctFunctionFirstKey); }else{ window.detachEvent("mousedown", ctFunctionFirstKey); window.detachEvent("keydown", ctFunctionFirstKey); } } //Writing first key press timestamp var ctFunctionFirstKey = function output(event){ var KeyTimestamp = Math.floor(new Date().getTime()/1000); ctSetCookie("ct_fkp_timestamp", KeyTimestamp); ctKeyStopStopListening(); }; if(typeof window.addEventListener == "function"){ window.addEventListener("mousemove", ctFunctionMouseMove); window.addEventListener("mousedown", ctFunctionFirstKey); window.addEventListener("keydown", ctFunctionFirstKey); }else{ window.attachEvent("onmousemove", ctFunctionMouseMove); window.attachEvent("mousedown", ctFunctionFirstKey); window.attachEvent("keydown", ctFunctionFirstKey); } // --> </script></body> </html> <!-- end: showthread -->