Jump to content

RandmTask

Member
  • Posts

    29
  • Joined

  • Last visited

Posts posted by RandmTask

  1. 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? 
     

  2. Is there a way such that when I type:

     

    mailto:support@acme.com

    or

    support@acme.com

     

    With any email address, it automatically drafts an email from my gmail account?

     

    I set up a simple workflow for the mailto: keyword using Open URL to https://mail.google.com/mail/?view=cm&to={query} which works, but Im not sure how to change the default behaviour for any email address typed into Alfred, or how to implement it into a workflow

     

    Thanks for any guidance!

     

     

     

     

    CleanShot2023-04-20at20_04_52.png.a06c59f885d2751d489d1994ec2f8c90.pngCleanShot2023-04-20at20_04_03.png.1793ab0620c487756c69f065d3bce315.png

  3. Hi Stephen

     

    Sorry for the confusion. The 7 in test7 was not the page number, I was only trying to align with your use of the word test but had already used test for something else.

     

    So, lets say instead of test7 the keyword is openpdf and I wanted to open page 300:

    openpdf 300

     

    The original script works:

    tell application "Preview"
        activate
        
        set theFile to POSIX file "~/Downloads/Fire.pdf"
        open theFile
        
        tell application "System Events"
            keystroke "g" using {command down, option down}
            delay 0.5
            keystroke "300"
            keystroke return
        end tell
    
    end tell

     


     

    Updated code doesn't:

    set theQuery to item 1 of arg
    
    tell application "Preview"
        activate
        
        set theFile to POSIX file "~/Downloads/Fire.pdf"
        open theFile
        
        tell application "System Events"
            keystroke "g" using {command down, option down}
            delay 0.5
            keystroke theQuery
            keystroke return
        end tell
    
    end tell

     

     

    This line seems to be the issue

     

    set theQuery to item 1 of arg

     

    As even if I keep keystroke "300" in the script it stops working

     

     

     

  4. Thanks Stephen

     

    I've tried both a simple keyword with an argument eg 'keyword 300' and a list filter to test it passing to the Run Script and it doesn't seem to work:

     

    I updated the code in a 'Run Script' module to:

    set theQuery to item 1 of arg
    
    tell application "Preview"
        activate
        
        set theFile to POSIX file "~/Downloads/Fire.pdf"
        open theFile
        
        tell application "System Events"
            keystroke "g" using {command down, option down}
            delay 0.5
            keystroke theQuery
            keystroke return
        end tell
    
    end tell

     

  5. Hi

     

    I have a PDF and I would like to use Alfred to let me select which chapter or page I want to open the PDF to.

     

    I am using a Script Filter and have two issues:

     

    1. When I press Enter on the search result it seems to do nothing. I have to use the right arrow and then hit Enter when I see 'Open'

    2. Im not sure of the arguments to get it to open to a certain page.

     

    Here is the workflow

     

     

    cat << EOB
    {"items": [
    
    
    
    	{
    		"uid": "image",
    		"type": "file",
    		"title": "Chapter 4",
    		"subtitle": "Reinforcement Learning Page 20",
    		"arg": "~/Dropbox/Fire.pdf",
    		"autocomplete": "abc",
    		"icon": {
    			"type": "filetype",
    			"path": "public.jpeg"
    		}
    	},	
    
    
    	{
    		"uid": "image",
    		"type": "file",
    		"title": "Chapter 6",
    		"subtitle": "Reinforcement Learning Page 60",
    		"arg": "~/Dropbox/Fire.pdf",
    		"autocomplete": "xyz",
    		"icon": {
    			"type": "filetype",
    			"path": "public.jpeg"
    		}
    	},	
    
    
    
    	{
    		"uid": "image",
    		"type": "file",
    		"title": "Chapter 10",
    		"subtitle": "Reinforcement Learning Page 88",
    		"arg": "~/Dropbox/Fire.pdf",
    		"autocomplete": "asd",
    		"icon": {
    			"type": "filetype",
    			"path": "public.jpeg"
    		}
    	},	
    
    
    
    
    ]}
    EOB

     

     

    I know I can open to a certain page (eg page 90) using AppleScript:

    tell application "Preview"
        activate
        
        set theFile to POSIX file "~/Dropbox/Fire.pdf"
        open theFile
        
        tell application "System Events"
            keystroke "g" using {command down, option down}
            delay 0.5 
            keystroke "90"
            keystroke return
        end tell
    
    end tell

     

     

    But not sure how to do it in my workflow

     

    I appreciate any guidance! 

     

    Thanks

  6. Hi 

     

    Im sure this is a simple question, but here goes, Im trying to use this applescript to open a PDF to a specific page in Preview eg. page 55:

     

    Quote

    tell application "Preview"
        activate
        open "/Users/user/Downloads/myfile.pdf"
        tell application "System Events"
            keystroke "55" using {command down}
        end tell
    end tell

     

     

    And I am getting this error:

     

    The file couldn't be opened because you don't have permission to view it. To view or change permissions, select the item in the Finder and choose File > Get Info.

     

    Permissions seem to be fine in Get Info however. And I can open the file normally in Alfred just fine using the "Open File"

     

    Ive tried other files with the same result.

     

    Any ideas?

     

  7. Feature request:

     

    Drag and drop an image (and possibly pasting) on to the Keyword Action to use that as an Icon

    Drag and drop an image on to the Workflow itself to use that as the Workflow Icon

     

    If I am duplicating a keyboard action, or saving it as a prefab, everything is replicated except for the icon, and I need to manually replace each of these. I would prefer to keep the images.

  8. Hopefully a simple question.

     

    I want to open a group of files all at once into an app. What I have tried previously just passes the files one by one and opens several instances of the app.

     

    I am trying to use Alfred to pass the selected Finder items to an app called 'Tag Editor.app'. Then I can tag all the files in the same window

     

    TIA for any assistance!

     

    Workflow

     

     

  9. Hi,

     

    Ive created a workflow that will allow you to highlight the selected text in Reddit while using Chrome and will copy the link and title to the clipboard. (Akin to the native Chrome Copy Link to Highlight feature, however Reddit blocks it)

     

    The workflow works well enough and it copies in Markdown formatting:

    [WEBPAGE_TITLE](url)

     

    What would be the best way to get it to paste as a hyperlink so when I paste it into TextEdit, Notes.app etc it appears as a hyperlinked Webpage title instead ie. WEBPAGE_TITLE?

     

    Any other feedback welcome as Im sure I haven't constructed this workflow very efficiently!

     

    https://www.dropbox.com/s/a0hbdc7vfvovv91/Reddit - Copy Highlight to Link.alfredworkflow?dl=1

     

    image.thumb.png.8eb805d83b42ddcf659cd3f2467c4325.png

  10. It's a work website. It is loading data for a few seconds after opening, and if you open any more pages on the same website it wont load the subsequent one unless the previous page has been fully loaded.

     

    Thanks for your help, it works great now, except that the first tab is a new tab and URL_HERE opens in the second tab, ANOTHER_URL_HERE in the third tab etc, but I can live with that.

     

    Thanks again!

  11. Is it possible to have a script that will open, say 20 tabs in a new Chrome window, with a 10 second delay between each?

     

    I haven't had any luck with the search function and at the moment I'm just attaching 20 Open URL objects to a keyword, which is messy and doesn't delay between loading each tab so it doesn't load properly.

     

    Don't have any experience with scripts so would appreciate a push in the right direction.

     

    Thanks!

  12. Hi,

     

    I can move selected files and folders in finder using alfred using a hotkey, using a script such as:

    mv -n "$@" "/Users/user/Downloads/Graphic Templates/"

     

    but would prefer to do it using keywords. 

    eg.

    mv graph --> /Users/user/Downloads/Graphic Templates/

    mv docs ---> /Users/user/Documents/Temp/Documents/

    mv misc --->  /Users/user/Dropbox/Misc/

     

    Can anyone share the best way to go about this? The search I've done links to workflows that are no longer available online.

     

    Thanks!

     

     

  13. Hi,

     

    When I type 'Applications' into Alfred, to open the Applications folder, it opens up ~/Applications which is an empty directory.

     

    All my Applications are stored in /Applications not in ~/Applications, so Im not entirely sure why Alfred is looking there.

     

    How can I get Alfred to open the /Applications folder instead? In the meantime I have set up a workflow to access it, however it is not the first result in a search.

     

    Thanks!

     

    image.thumb.png.46d3eb254dbefe9b18b0f70632470902.png

     

     

     

    image.thumb.png.6c325b57f3bd20d34b19075dd77aed00.png

  14. A couple of suggestions:

     

    1. Be able to duplicate Web Searches. ie I like to have multiple Google based ones, where I would like to keep the icon, most of the URL, title, etc and just modify a couple of things. I do the same for work websites and especially any multiple websearches that will have the same icon.

    2. When I want to search eg. YouTube Music I would type ym query. It would be great that if we omitted the query ym would go straight to the main page music.youtube.com. This would be great for almost all of my web searches, without having to make duplicate ones with different keywords. ie ym query for a search and yms to go to YouTube music's main page

    3. For their to be a subtext option, similar to in Workflows

     

    Hope these are useful

×
×
  • Create New...