Search PDF contents for ISBN number and save to text file

Hi,
Hoping someone can help me create a script that can find the ISBN inside of a PDF and write that filename and number to a text file.
I've found a way to do this using java using and document processing in Acrobat but I need to do it by pointing at a folder of files.
Format desired would be:
original filename.pdf, isbn#
Any help is appreciated,
John

you could give the command line tool ps2ascii a try. It also works with pdf and you could  pipe it's output (pure text) to a nice perl/ruby/grep/sed/awk 1-liner to extract the isbn numbers (still have to read a book about Regular Expression ;-) )
I did a quick & dirty version, but I think you will have to install ps2ascii first. I don't remember but I think it was installed with ghostscript (using macports)
--30.04.2011 hubionmac.com
--quick & dirty script to extract first ISBN-Number of a PDF file... just uses grep, maybe some nice reqexp would do a better job!
set myselection to choose file of type {"pdf"} with multiple selections allowed
set myoutput to ""
repeat with pdf_file in myselection
tell application "Finder" to set pdfname to name of (pdf_file as alias)
set pdf_file_posix to quoted form of POSIX path of (pdf_file as alias)
do shell script ""
try
--first add the path, otherwhise s2ascii will fail since it cannot find ghostscript (gs) which is also installed in /usr/local/bin (think by macports)
set ISBN_String to do shell script "PATH=\"$PATH:/usr/local/bin\"; /usr/local/bin/ps2ascii " & pdf_file_posix & " | grep -m 1 ISBN"
set foundLine to true
on error
display dialog "maybe \"" & pdfname & "\" does not contain a ISBN at all"
set foundLine to false
end try
if foundLine is true then
repeat with s in every word of ISBN_String
try
get s as integer
set s to s as text
set foundisbn to true
exit repeat
on error
set s to ""
end try
end repeat
end if
set myoutput to myoutput & pdfname & tab & s & return
end repeat
tell application "TextEdit"
activate
set a to make new document
set text of a to myoutput as text
end tell

Similar Messages

  • Browse users presentation server directory and save a text file in it

    Hi All,
    We have a requirement in which I need to provide two buttons Browse and Export in CRM web UI with following functionality:-
    1) On click of browse button user should have an option to browse and select a folder(not file) from presentation server(useru2019s computer).
    2)Once user selects a folder and click export button, I need to save a text file in this folder.
    Any help on any of the above two requirements will be highly appreciated.
    Regards,
    Vimal

    Hey Vimal,
    did you find a solution for your problem?
    Actually I'am facing exactly the same issue.
    Thank you very much.
    Regards
    Marc

  • If I buy the Adobe Export PDF for $23.99/yr - will that allow me to work with a PDF fillable form -- then rename and save that form?

    If I buy the Adobe Export PDF for $23.99/yr - will that allow me to work with a PDF fillable form -- then rename and save that form?

    I want to fill in the blanks on a PDF form --
    Then I want to rename the form and save it.
    Beverly Visitacion
    Location Scout/Manager
    Cell:  305 322-1586
    Fax:  305 328-9666
    [email protected]
    Michael Jarvis
    Location Scout/Manager
    Cell:  305 335-6266
    [email protected]
    "ARMS & THE DUDES"

  • How to change and save a new file in Edge web Lumira server for Team ?

    Hi Lumira folks,
    I've installed SAP Lumira 1.0, Edge edition and View a sample 'Dairy Wholesaler-Sample"
    I'd like to change it and save as new file, but "Save" button is disabled and when I put my mouse over the button,
    it says "Save Option is disabled in this version".
    Is there any idae how to change and save as a new file in Lumira Edge ?
    Many Thanks.
    JH

    I've just found the reason as below.
    http://scn.sap.com/community/lumira/blog/2015/03/20/lumira-server-for-teams-edge-edition-version-compatibility
    The current version of Lumira
    server for teams is 1.0. This version uses Lumira 1.22 as its 'engine' as this
    was the version of Lumira Desktop that was shipped at the same time.
    Hence with the current Lumira
    version compatibility; namely that a newer version of the product can open an
    older document, but an older version cannot open a newer document, care must be
    taken when deploying Lumira server for teams.
    Lumira server for teams is only
    compatible with Lumira desktop 1.22. If you intend to deploy Lumira server for
    teams, ensure your desktop users do not move to a later version of the desktop.
    Content created in a later version of Lumira desktop can be uploaded and shared
    via Lumira server for teams, but it cannot be viewed or edited online in the
    browser.
    Ensure desktop users disable the
    auto update capabilities in the desktop preferences, and set the update to
    none.

  • HT4753 would number automatically save an .xlsx file I opened and modified but not saved? I've lost a file with many edits...

    would number automatically save an .xlsx file I opened and modified but not saved? I've lost a file with many edits...

    kearly - thanks a million for posting both the question & the reply! I just unchecked that little box by accident, & couldn't figure out for the life of me how to fix it. Thanks again!!

  • How to Change Outlook Default Folder for Insert-Attachment and Save Email/Attachemnt while Outlook is open (VBA)

    Hello,
    Office 2010 32bit, VBA
    Is it possible to programmatically do the above while Outlook is running?  If so, I'm hoping to make that change from a Word macro.
    I tried tinkering with the reg key and that doesn't work because it appears Outlook only respects it at startup time. Similary changing Word File-options-location of documents is respected only when Outlook starts.
    I'm looking to seamlessly keep Outlook's default folder in sync with Word's default folder as the users change working folders in Word, which they do many times per day (and they chose the folder among a couple of thousand possibilities).
    I'm hoping there is a difficult-to-find Outlook object I can manipuate to get to the end result.  IF there is such an Object I have been unable to find it.
    Many thanks!
    Julie

    Hi Julie,
    Based on my research, I think outlook object model doesn’t provide the way to change the default folder for insert attachment and save email/attachment.
    The way to change it is that we need to modify the registry setting and the outlook app should be restart.
    # How to set the default attachment folder in Outlook
    https://support.microsoft.com/kb/252732?wa=wsignin1.0
    You may create the add-in to custom these actions (e.g. attach attachment, save email)
    Regards
    Starain
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Report for Asset number and its Purahcse order number

    Hello Friends,
    Please give me details of report for Asset number and its Purchase order number .
    Regards
    Nilesh Vakil

    hi,
    GO to ME2N...
    use SHIFT + F4..
    there check for the acc. assign cata. field and input the asset  and execute..
    Regards
    Priyanka.P

  • Solution for Slow Open and Save As Dialogs under 10.4.4

    I don't know how many others out there may be experiencing this, but...
    I noticed that -- after updating to 10.4.4 -- I started getting really long delays when accessing Open and Save As file dialogs -- I mean, sometimes it would take 5 to 15 seconds for the dialog to appear!
    I did a lot of troubleshooting, and finally hit upon the solution a couple of nights ago:
    It's the Desktop iDisk!
    Going into the .Mac Preference Pane and turning off "iDisk Syncing" has totally eliminated the slowdown.
    I think it has something to do with DiskMirrorAgent, since that has frozen on me a couple of times and prevented logoff until I force-quit it.
    'Hope this helps.
    -- Steve
    Late 2005 DC G5 2.3 GHz, 4 GB RAM   Mac OS X (10.4.4)  

    Hi Matt,
    One can always manually mount the iDisk when needed, and it still syncs, albeit in real time, and kind of herky-jerky.
    As for the slowdown when multiple items are mounted, I believe I'm describing a different issue, related to DiskMirrorAgent. If and when you get this slowdown (with desktop iDisk syncing enabled), check Activity Monitor, and you'll see DiskMirrrorAgent sucking up most of the CPU time for the time it takes before the dialog appears. My record time was about 25 seconds.
    As for slow Open and Save As dialogs when multiple items are mounted: I customarily have several external FireWire drives mounted, and often a couple of CDs and/or DVDs (I produce a radio program, and have several optical drives), and I have had no Open or Save As dialog slowdowns since at least 10.3.x, maybe earlier.
    Even when the dialog opens to a directory on a CD that has spun down, the opening time on an Open or Save As dialog is nearly instantaneous for me, suggesting that Mac OS X 10.4.x is doing a good job of caching the data.
    But I hear you about the "old days," when it used to take forever to get a dialog to appear, just because a CD was mounted! Maddening!
    -- Steve
    Late 2005 DC G5 2.3 GHz, 4 GB RAM   Mac OS X (10.4.4)  

  • I want to run a vi for 4 days and save 360,000,000 samples in a file

    Hi
    I want to run a vi for 4 days and save samples to a file.
    I use the Ni EX save to file.vi example provided by LabView and change the Trigger mode to "immidiate ref trigger" as I am measuring a DC voltage.
    The application runs correctly when min record length is 2048 however when I change the min record length to 2,000,000 I receive the following error message and nothing get saved:
    Error occurred at:  niScope Multi Fetch.vi
    <err>Driver Status:  (Hex 0xBFFA2003)
    Maximum time exceeded before the operation completed.
    Possibly no trigger received. Buffers done: 0, Points done: 0.000000.
    I appreciate if you help me in this regard,
    Maryam

    Maryam,
    Have you tried increasing the timeout?  What is the exact name of the vi that you are using. Also, what hardware are you using?  What driver versions do you have installed?  Actually, the more information you could give us, the better.  Thanks and have a great day!
    Regards,
    Lon A.

  • Pls send me PDF'S for Integration Repository and Mapping

    Hello All,
    I need to make presentation.
    Pls send me different PDF'S for Integration Repository and Mapping
    Regards

    Henry,
    I hope this will help you.
    http://help.sap.com/bp_bpmv130/Documentation/Operation/MappingXI30.pdf
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d046c490-0201-0010-84b6-9df523cbca31
    raj.

  • How to import missing content for my music and video files from Itune online

    how to import missing content for my music and video files from I tune online.

    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • How can I set up an SMS group so that all group members can dial a group number and have a text sent out to all members of the group

    How can I set up an SMS group so that all group members can dial a group number and have a text sent out to all members of the group
    This would be an SMS group similar to an email listserv but running on the SMS network
    I have seen private individuals offering this service
    It seems strange to me that no internet site like Apple, Yahoo or Google offers this as a free service much as the email group services are free services.
    Steve

    I think the app GroupMe might do what you want. You might also try contacting your carrier. My carrier offered some fancy group texting service for a while but they never really advertised it so, unless you asked, you never would have known. But, GroupMe is available in the app store. There are lots of other apps that also do group texting but it seems to be the one that gets recommended the most.

  • How to list the contents of an OSX directory, and output to text file?

    hello there any hints with any known program that does following
    I have recorded my music directory to DVD and now i would like to make an .txt file what the dvd contains...cos its way of hand to write all 100xx files by hand...
    How to list the contents of an OSX directory, and output to text file?
    any prog that does that? any hints?
    best regards

    This script makes a hierarchical file listing all files in a folder and subfolder:
    Click here to launch Script Editor.
    choose folder with prompt "Choose a folder to process..." returning theFolder
    set theName to name of (info for theFolder)
    set thepath to quoted form of POSIX path of theFolder
    set currentIndex to theFolder as string
    do shell script "ls -R " & thepath returning theDir
    set theDirList to every paragraph of theDir
    set newList to {"Contents of folder \"" & theName & "\"" & return & thepath & return & return}
    set theFilePrefix to ""
    repeat with i from 1 to count of theDirList
    set theLine to item i of theDirList
    set my text item delimiters to "/"
    set theMarker to count of text items of thepath
    set theCount to count of text items of theLine
    set currentFolder to text item -1 of theLine
    set theFolderPrefix to ""
    if theCount is greater than theMarker then
    set theNestIndex to theCount - theMarker
    set theTally to -1
    set theFilePrefix to ""
    set theSuffix to ""
    repeat theNestIndex times
    set theFolderPrefix to theFolderPrefix & tab
    set theFilePrefix to theFilePrefix & tab
    if theTally is -1 then
    set theSuffix to text item theTally of theLine & theSuffix
    else
    set theSuffix to text item theTally of theLine & ":" & theSuffix
    end if
    set currentIndex to "" & theFolder & theSuffix
    set theTally to theTally - 1
    end repeat
    end if
    set my text item delimiters to ""
    if theLine is not "" then
    if word 1 of theLine is "Volumes" then
    set end of newList to theFolderPrefix & "Folder: > " & currentFolder & return
    else
    try
    if not folder of (info for alias (currentIndex & theLine & ":")) then
    set end of newList to theFilePrefix & tab & tab & tab & "> " & theLine & return
    end if
    end try
    end if
    end if
    end repeat
    open for access file ((path to desktop as string) & "Contents of folder- " & theName & ".txt") ¬
    with write permission returning theFile
    write (newList as string) to theFile
    close access theFile

  • I have a Macbook Air (july 2012) with OS X 10.8.3  installed.  I have dvds with .vob files and have Quicktime Version 10.2 (603.12).  I can't play the DVDs.  Thereare some features of QT that I like, e.g. precise frame selection and save as .png file-help

    I have a Macbook Air (july 2012) with OS X 10.8.3  installed.  I have dvds with .vob files and have Quicktime Version 10.2 (603.12).  I can't play the DVDs.  There are some features of QT that I like, e.g. precise frame selection and save as .png file-help.  Am I missing some Apple software?  I thought QT for Mountain Lion could convert the .vob files - is there some setting that I have missed?
    Any suggestions that preserves a simple workflow much appreciated.

    arthur wrote:
    Perian is here: Perian - The swiss-army knife of QuickTime® components
    Perian will be retired soon.

  • I cannot download and save an eps file in Adobe Photoshop Elements 12

    I am unable to open and save an eps file in Adobe Photoshop Elements 12

    No, EPS is one of the formats that adobe removed support for, starting with PSE 11.

Maybe you are looking for

  • I want to export only MP3 formatted songs to my SD card.

    I bought a new power pod 360 speaker that will play music on a SD card.  It only supports MP3 format, and I changed the format on all of my iTunes music library today.  It actually left the original and added the new version underneath.  However, I a

  • Beep before POST 3 - 1 - 4 - 3 Z60m freeze when tilted / moved

    is this a system board issue?  I pulled the dimms and cpu & put back & now I can boot up but when I move the machine or tilt it ever so gently it will lock up and will only restart if  I press & hold power button. Any chance the Active hard drive pro

  • Image doesnt reflect...in my pdf

    Hi I have used an image in my PDF...using image control from standard library.. i have given the source from localssystem when i run i can see it displaying in my system..but not in another system.. Y so...solution pls! HARSH

  • How to publish iPhone videos on facebook?

    Took a video on Iphone 4S and cannot seem to publish to FaceBook.  Any ideas?

  • Can't install Arch (SOLVED)

    Hello everyone. I'm already an Arch user and I'm very happy with it. The problem is that now I'm trying to install another Arch on another HD (to try out KDE4 without breaking my previous Arch install). The problem is that everytime I want to install