Jump to content

pixelgeek

Member
  • Posts

    110
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by pixelgeek

  1. I have an AppleScript that I am trying to run in Alfred

     

    on run 
    	
    	set theQuery to "{query}"
    	set theFileList to {}
    
    	repeat with aFile in paragraphs of theQuery
    		copy (POSIX file aFile) to the end of theFileList
    	end repeat
    
    	tell application "Freeform"
    	
    		activate
    	
    		repeat with aFile in theFileList
    			set the clipboard to aFile
    			tell application "System Events" to keystroke "v" using command down
    		end repeat
    	
    	end tell
    
    end run

     

    This runs fine in Script Debugger (I hardcore the query) but when I try to run it in a Run Script object I get

     

    [21:34:28.807] ERROR: Anagram Tiles[Run Script] 471:477: execution error: An error of type -4960 has occurred. (-4960)

     

    I am assuming that it is a Privacy and Security issue. Alfred doesn't appear to have the correct permissions but it is also not asking for them.

     

    I have tried to reset the permissions and then re-enable them but I still get the error.

     

    I tried putting the code into two try blocks but it doesn't generate any errors which makes me think that it is a Permissions issue.

     

    Anyone had a similar problem? 

    CleanShot 2023-03-02 at 21.25.40@2x.jpg

    CleanShot 2023-03-02 at 21.25.52@2x.jpg

  2. 3 hours ago, Stephen_C said:

    It's a really well, elegantly set out workflow of the kind I much appreciate: well done!

     

    Thanks. 

     

    3 hours ago, Stephen_C said:

    It almost (but not yet, quite) tempts me to break the habit of a lifetime and install a workflow that has an external dependency.

     

    The sound or the command line app?

  3. 10 minutes ago, vitor said:

    Which method will you use going forward?

     

    Which do you prefer? I don't really have any preference. Whichever makes your work easier. 

     

    11 minutes ago, vitor said:

    And the sound you picked made me laugh! Does it ship somewhere with macOS or did you get it from somewhere else?

     

    It is from the Alfred Labs sound pack.

    11 minutes ago, vitor said:

    In the previous version I tested, entering an extension without the . also worked.

     

    I'll remove it when I do the next update. 

  4. So I found a quicker way to get a list of UTIs for an extension. It does require the duti command line app in order to run. You can get it from their website or use brew

     

    brew install duti

     

    Once you have that installed you can just run

     

    duti -e .md |  grep UTTypeIdentifier | awk '{ print $3 }'

     

    and get a list of the UTIs from there

     

    public.markdown
    com.unknown.md
    net.daringfireball.markdown
    net.daringfireball

     

    I will make a Workflow for it tomorrow. Still suffering from a cold so I think I am at my limit for today 🙂

  5. So it isn't a bug but it is a result of everyone and their uncle declaring a different UTI for Markdown files. I have four different UTIs listed on my Mac

     

     net.daringfireball.markdown
     com.unknown.md
     net.daringfireball
     public.markdown

     

    Once I added all of them to the File Type list it was able to show the Markdown files in the File Filter.

     

    If anyone ever needs to track down the same issue this is the command you can use in the Terminal

     

    /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep 'uti:' | awk '{ print $2 }' | sort | uniq 

     

    This would probably also be an issue if one had multiple apps attempting to create different UTIs for an open file type. 

  6. I have a very basic Workflow that has a File Filter input and an Open object.

     

    If I set the File Types in the File Filter by dragging one of my Markdown files into the Types area and then run it the Filter won't display any files. If I remove the File Type it will see the Markdown files and list them.

     

    Is this a bug or am I doing something wrong?

     

    The Markdown file I am using to set the File Type is from the directory listed in the Scope. 

    CleanShot 2023-02-28 at 19.05.43@2x.jpg

  7. So I assume that Action Modifiers are only available for Inputs. 

     

    I have a workflow that has two steps that always run and I then have either one or two steps that I want to run conditionally (see attached image). 

     

    I currently can't see any way to create a conditional branch after the first Run Script so will I have to duplicate the Split Args and Run Script or is there a way to check for a user modifier after the Run Script?

    Screenshot 2023-02-27 at 8.41.44 AM.png

  8. I am trying to build a similar action in a few different apps as part of an article I am writing. The action I have is:

     

    • take user input
    • open the Freeform app
    • iterate over each character to build a file path
    • copy the file to the clipboard
    • paste the file

     

    Is it possible to iterate over each character of that in Alfred or am I going to have to hand off that data to a script or to KM?

     

    Thanks

  9. 1 hour ago, vitor said:


    You write them there as well, duplicate the information. Separate each with a character that doesn’t show up in either (e.g. newline) then split them in the next object.

     

    If that’s still confusing, please provide a basic version of the workflow so we can help you within context.

     

    I get it now.

     

    I thought initially that there was some way to get the List Filter to emit them as part of the output

     

    Thanks

  10. Sorry, not describing the issue clearly enough. 

     

    In his response @vitor says

     

    On 5/1/2020 at 6:52 PM, vitor said:

    Then you need to make the title and subtitle part of the argument, so they’re passed downstream.

     

    This is the part that I don't understand. When I have a List Filter in a Workflow it doesn't output the title and subtitle for me to get later. How do I make them part of the arguments send by the List Filter?

     

    Thanks 

×
×
  • Create New...