Jump to content

Searching PDF's in Skim


Recommended Posts

Hi 

 

Im trying to search a PDF in the app Skim using Alfred:

 

        on run argv
      set theQuery to item 1 of argv
      tell application "Skim"
        activate
        open "/Users/username/Dropbox/xys.pdf"
        set foundText to find front document text theQuery
        select foundText with animation
      end tell
    end run

 

This kind of works, it 'finds' one instance of the word and highlights it.

However I would like it to 'search' for all instances of the word and show the results in the left hand side pane.

Any ideas how to modify my applescript to achieve this? 
 

Edited by RandmTask
Link to comment
  • RandmTask changed the title to Searching PDF's in Skim

You might get a better answer if you ask Skim instead. They seem to have a comprehensive AppleScript dictionary, and in this case what you really care for is Skim the app and the AppleScript, Alfred is acting as the glue between the two interfaces (and it seems you already have that part working).

Link to comment
  • 1 month later...
On 5/3/2023 at 5:58 PM, RandmTask said:

Hi 

 

Im trying to search a PDF in the app Skim using Alfred:

 

        on run argv
      set theQuery to item 1 of argv
      tell application "Skim"
        activate
        open "/Users/username/Dropbox/xys.pdf"
        set foundText to find front document text theQuery
        select foundText with animation
      end tell
    end run

 

This kind of works, it 'finds' one instance of the word and highlights it.

However I would like it to 'search' for all instances of the word and show the results in the left hand side pane.

Any ideas how to modify my applescript to achieve this? 
 

 

@RandmTask have you got the answer for it? would be great if you can share update.

 

Some related questions on pdf search:

 

I have a few questions related to PDF search functionality in Alfred and I'm hoping to receive some guidance on improving it. Currently, I'm utilizing the "in" keyword, which is a standard feature in Alfred, for searching file content. With the help of a workflow, I've set up a specific search within PDF files using a file filter with the keyword "pdfin" and an additional field called "kMDItemTextContent" to open the corresponding file.

 

However, I'm facing some challenges with regard to conducting multiple-word searches within the same document and on the same page, as well as performing exact searches. I would greatly appreciate any suggestions or solutions to address these issues.

In my ideal scenario, I would like to perform an exact search inside a PDF by simply typing the keyword "pdfin" followed by the desired "exact phrase". Unfortunately, this approach doesn't seem to work as expected in Alfred. I have noticed that Spotlight allows for exact searches and searches with multiple arguments, making me wonder if Alfred can achieve similar capabilities.

 

If anyone has encountered a similar situation or has insights into improving the PDF search functionality via Alfred, I would be grateful for your input. Any suggestions, tips, or alternative approaches would be highly appreciated.

Link to comment
On 6/7/2023 at 10:33 PM, TomBenz said:

 

@RandmTask have you got the answer for it? would be great if you can share update.

 

Some related questions on pdf search:

 

I have a few questions related to PDF search functionality in Alfred and I'm hoping to receive some guidance on improving it. Currently, I'm utilizing the "in" keyword, which is a standard feature in Alfred, for searching file content. With the help of a workflow, I've set up a specific search within PDF files using a file filter with the keyword "pdfin" and an additional field called "kMDItemTextContent" to open the corresponding file.

 

However, I'm facing some challenges with regard to conducting multiple-word searches within the same document and on the same page, as well as performing exact searches. I would greatly appreciate any suggestions or solutions to address these issues.

In my ideal scenario, I would like to perform an exact search inside a PDF by simply typing the keyword "pdfin" followed by the desired "exact phrase". Unfortunately, this approach doesn't seem to work as expected in Alfred. I have noticed that Spotlight allows for exact searches and searches with multiple arguments, making me wonder if Alfred can achieve similar capabilities.

 

If anyone has encountered a similar situation or has insights into improving the PDF search functionality via Alfred, I would be grateful for your input. Any suggestions, tips, or alternative approaches would be highly appreciated.

 

@vitor any inputs on how to do an exact phrase search inside pdf file? many thanks

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...