lucasgpr Posted May 26, 2013 Share Posted May 26, 2013 Hi, it`s possible search in pdf file with some words? Example: search "enable all options" in tutorial.pdf, Alfred show me one part of the pdf, after click directs me the search term? Thanks. Link to comment
jdfwarrior Posted May 28, 2013 Share Posted May 28, 2013 Hi, it`s possible search in pdf file with some words? Example: search "enable all options" in tutorial.pdf, Alfred show me one part of the pdf, after click directs me the search term? Thanks. Alfred can indeed search within the contents of a PDF document but it wouldn't open the document to the location that the search term was found in the document, it would only open the document. This COULD be done would be rather tricky and would take a bit of a custom workflow to achieve it. You would have to create a workflow to save the search text, then using a script filter search for matching files manually. After a file is selected, using the remaining portion of the workflow to open it, and then search (using Preview?). The search could be done using AppleScript like this: tell application "Preview" activate tell application "System Events" tell process "Preview" click menu item "Find…" of menu "Find" of menu item "Find" of menu "Edit" of menu bar item "Edit" of menu bar 1 keystroke "{query}" end tell end tell end tell Where {query} would be replaced by the search text lucasgpr 1 Link to comment
Blumentopfgewinner Posted May 28, 2013 Share Posted May 28, 2013 It would be great to have the query term put into preview's searchbar by default. Link to comment
jdfwarrior Posted May 29, 2013 Share Posted May 29, 2013 It would be great to have the query term put into preview's searchbar by default. It can be, but as I said, it's just a bit of a more complicated workflow. Link to comment
lucasgpr Posted May 31, 2013 Author Share Posted May 31, 2013 (edited) Alfred can indeed search within the contents of a PDF document but it wouldn't open the document to the location that the search term was found in the document, it would only open the document. This COULD be done would be rather tricky and would take a bit of a custom workflow to achieve it. You would have to create a workflow to save the search text, then using a script filter search for matching files manually. After a file is selected, using the remaining portion of the workflow to open it, and then search (using Preview?). The search could be done using AppleScript like this: tell application "Preview" activate tell application "System Events" tell process "Preview" click menu item "Find…" of menu "Find" of menu item "Find" of menu "Edit" of menu bar item "Edit" of menu bar 1 keystroke "{query}" end tell end tell end tell Where {query} would be replaced by the search text David, Please help me implement this script, how to create a workflow to save search text? I am using "in" to find inside the pdf, would like to click in archive to execute your script and show me what was sought. Thanks. Edited June 1, 2013 by lucasgpr Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now