Jump to content

dfay

Member
  • Posts

    1,054
  • Joined

  • Last visited

  • Days Won

    61

Posts posted by dfay

  1. If you have a script that can paste an arbitrary image into an arbitrary app, setting up a list filter to choose from options is trivial in Alfred.  But the underlying functionality you’re looking for isn’t something built in.

     

    See https://forum.latenightsw.com/t/how-do-i-copy-image-file-to-clipboard-and-retain-format/590/9 for some approaches to scripting images on the clipboard.

  2.   In any case here's the code (from the workflow linked above) - it's a pretty trivial bit of AppleScript - the function call is just there b/c I had it lying around.

     

    on alfred_script(q)
    	click_menu("Finder", "Window", "Merge All Windows")
    end alfred_script
    
    on click_menu(app_name, menu_name, menu_item)
    	try
    		tell application app_name
    			activate
    		end tell
    		tell application "System Events"
    			tell process app_name
    				tell menu bar 1
    					tell menu bar item menu_name
    						tell menu menu_name
    							click menu item menu_item
    						end tell
    					end tell
    				end tell
    			end tell
    		end tell
    		return true
    	on error error_message
    		return false
    	end try
    end click_menu

     

  3. Here's what I use - called from a keyword with space & argument required, in a Run Script object set to osascript (AS) with input as {query}

     

    on run
    	set theQuery to "{query}"
    	tell application "HoudahSpot"
    		search theQuery template POSIX file "/Users/username/Library/Application Support/com.houdah.HoudahSpot4/Templates/templatename.hstemplate"
    	activate
    	end tell
    end run

     

  4. On 2/2/2021 at 7:49 PM, Chris Messina said:

    Alfred could better support routing x-callbacks or deeplinks directly to the corresponding native apps, rather than going through a browser first.

    This thread started out with a complaint about an issue which does not actually exist.  Yes, the UI is old and probably predates the widespread use of URL schemes on MacOS, and hence might be confusing if you haven’t tried calling a URL scheme from Alfred.  But why not try it and see what happens before posting criticism?  I suspect that’s what put people off.

  5. No, the OS handles it (via LaunchServices), and sends it to the registered app for the URL type.  You can test this by typing craftdocs:// into Alfred and then into Safari - when you call it directly from Alfred the app opens straight away, when you call it from Safari, you need to confirm that you want to allow a web page to open the app.

     

    More details here: https://kaihao.dev/posts/Make-your-own-custom-URI-scheme-resolver

     

  6. If you look at the metadata the kind of these is “App Library” not “Folder”.  But I’m not sure if that will help with a solution - I set up a targeted workflow as you describe for ScanBot & it still works despite the app name changes.

     

    I just tried dragging one into a file filter and its kind is as if it’s a folder even though it’s not.  

×
×
  • Create New...