Jump to content

Amoftcoorb

Member
  • Posts

    0
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Amoftcoorb reacted to dansherman in Permissions for sandboxed apps?   
    I started on a workflow to call PDFPenPro via applescript to run OCR on the selected files. I have an automator service that does it, but I like Alfred better.
     
    The problem I'm having is that PDFPen refuses to open the file because it doesn't have permission.
     
    I checked with their support people, and they said that since the script works in AppleScript Editor and Automator, it must be an Alfred problem... 
     
    Here is the code. For testing purposes the file action only accepts one file, but if I can get that to work I'll add support for multiple files.
    on alfred_script(q) tell application "PDFpenPro 6" open q tell document 1 ocr repeat while performing ocr delay 1 end repeat delay 1 close with saving end tell end tell end alfred_script  
    It is currently in an NSAppleScript action, but I've tried it as a /bin/osascript too. Even using /bin/bash or /bin/python to pass the query to a standalone script (using argv) come up with the same error, so does using osascript from the terminal. 
     
    Thoughts?
  2. Like
    Amoftcoorb reacted to jdfwarrior in [HOW TO] Script Filters: Reusing a single script filter or chaining multiple together   
    This tutorial is aimed at Alfred 2. Alfred 3 allows you to connect one Script Filter to another, so these workarounds are not necessary. (They might still be interesting, however.) [added 2017-03-20 by deanishe]
     
    Provided below is a workflow that provides a demonstration of how to reuse a single script filter or, how to chain multiple script filters together so that you can create the illusion of having multiple steps or allow you to further refine results from the first script filter, using the second.
     

     
    Demo 1
    This demo shows how you can use AppleScript to call the next step (another script filter) after the first script filter has completed. This could be used to send the value of the first script filter into the second, or, you could just save the values to file and then read them all back in when you are done. This example will save the value to file.
     
    Demo 2
    This demo shows how you can reuse a single script filter using autocompletion to separate multiple inputs with a delimiter. When the filter completes, you could then use that delimiter to split the string into its multiple parts. This works really well if your input data is numeric or short strings.
     
    Demo 3
    This demo shows how you can reuse a single script filter, with AppleScript to provide multiple inputs/steps to the end user.The data entered by the user is saved to file in each step, then read in and appended together at the end. You could separate the final output with a delimiter and pass it on to something else if you wanted.
     
    There are many ways that this could be customized to your liking. Change the delimiters, how values are passed, etc. This thread is merely meant to provide examples of how this could be accomplished for those interested.
     
    Download the demo workflow here.
  3. Like
    Amoftcoorb reacted to greghoch in Script Filter: Clear results list and show the "Please Wait" message again   
    Hi, 
     
    is it possible to clear results list and show the "Please Wait" message again? I would like to show the results from the last search when the query=="" (which works), clear the result list when the user starts typing a search term and show the "Please Wait" message, and show the results list when they are ready.
     
    Thanks!
  4. Like
    Amoftcoorb reacted to albertkinng in How to always have favorite apps as first suggestions?   
    ok, I always launch Alfred to open files on a couple of apps, and I always use the same apps isn't a way to have always a couple of Apps first in line every time Alfred is launch? I hate to scroll to the app on the list everytime because the other apps are never used for anything! any trick/ hack? settings for this? Pretty please please?
  5. Like
    Amoftcoorb reacted to fosterj in Workflow for Wunderlist 2 ?   
    Hi !
     
    Anyone for this ? Thanks in advance ..
  6. Like
    Amoftcoorb reacted to B9E in Basic Workflow Keyword Question   
    I had this set up in Alfred V1 but am having trouble in V2.
     
    I'm trying to get it that when I type "b2" <enter> Alfred opens a folder, and when I type "b2 " (with a space) and then a query, the search results from inside that folder are displayed.  This is how I have it set up:
     

     
    The problem is that if I type "b2" this is the result:
     

     
    If I then hit enter, Alfred autocompletes the space after "b2" for the search and waits for me to type text to search for, rather than opening the folder.  Make sense?  Is there a workaround or better method of accomplishing what I want?
     
    Thanks.
  7. Like
    Amoftcoorb reacted to jdfwarrior in Generating Feedback in Workflows   
    The Format
     
    ** This will be an evolving document. Check here for updates and new documentation. **
     
    There is also an XML format example available in Alfred 2 preferences. To see it, open Alfred Preferences, navigate to Workflows. Click the + i nthe bottom right corner of the installed workflows list, select Examples->Script Filter XML format.
     
    Result feedback is generated by returning an XML string back to Alfred from a Script Filter item in your Workflow. Script Filters are the only way to pass feedback to Alfred. The following is an example XML string that would be returned to Alfred.
    <?xml version="1.0"?> <items> <item uid="rdioartist" arg="r96664" valid="yes" autocomplete="Incubus"> <title>Incubus</title> <subtitle>Artist</subtitle> <icon>rdio-artist.png</icon> </item> <item uid="albumart" arg="/Users/user/Documents/album.jpg" type="file"> <title>Incubus Album Art</title> <subtitle>Album Art for Science</subtitle> <icon type="filetype">public.jpeg</icon> </item> </items> Results will be returned as a list of "items", with each one being an "item" inside. Each item has several arguments and pieces of information associated with it.
     
    Item Attributes
     
    uid (optional in Alfred 2.0.3+)
    The uid attribute is a value that is used to help Alfred learn about your results. You know that Alfred learns based on the items you use the most. That same mechanism can be used in feedback results. Give your results a unique identifier and Alfred will learn which ones you use the most and prioritize them by moving them up in the result list.
     
    As of Alfred 2.0.3, this attribute is now optional. If no uid is provided, Alfred will simply generate a UUID. This will allow you to maintain a specific order of generated feedback. Previously, the uid (if not unique for each result) would be added to Alfred's knowledge and would be prioritized in later executions.
     
    arg
    The arg attribute is the value that is passed to the next portion of the workflow when the result item is selected in the Alfred results list. So if you pressed enter on the sample item above, the value 'r96664' would be passed to a shell script, applescript, or any of the other Action items.
     
    type
    The type attribute allows you to specify what type of result you are generating. Currently, the only value available for this attribute is file. This will allow you to specify that the feedback item is a file and allows you to use Result Actions on the feedback item.
     
     
    valid ( optional - Defaults to 'yes' )
    The valid attribute allows you to specify whether or not the result item is a "valid", actionable item. Valid values for this attribute are 'yes' or 'no'. By setting a result's valid attribute to 'no', the item won't be actioned when this item is selected and you press Return. This allows you to provide result items that are only for information or for help in auto completing information (See autocomplete flag below).
     
    autocomplete ( optional - Only available when valid = no )
    The autocomplete attribute is only used when the valid attribute has been set to 'no'. When attempting to action an item that has the valid attribute set to 'no' and an autocomplete value is specified, the autocomplete value is inserted into the Alfred window. When using this attribute, the arg attribute is ignored.
     
    Elements
     
    title
    The title element is the value that is shown in large text as the title for the result item. This is the main text/title shown in the results list.
     
    subtitle
    The subtitle element is the value shown under the title in the results list. When performing normal searches within Alfred, this is the area where you would normally see the file path.
     
    icon ( optional - If not icon value is available, the icon will be blank. If the icon element is not present, a folder icon will be used )
    The icon element allows you to specify the icon to use for your result item. This can be a file located in your workflow directory, an icon of a file type on your local machine, or the icon of a specific file on your system. To use the icons of a specific file type or another folder/file, you must provide a type attribute to the icon item. 
    Example: <icon type="fileicon">/Applications</icon> - Use the icon associated to /Applications
    Example: <icon type="filetype">public.folder</icon> - Use the public.folder (default folder) icon
  8. Like
    Amoftcoorb reacted to R4z3r in [PHP] Leverage Alfred Search to find closest match in array   
    Hey,
     
    I was wondering if there was a good way to leverage the search autocomplete via PHP. I am looking to add easy timezone support to my workflow (based on these timezones — http://www.php.net/manual/en/timezones.php). I would like to make a PHP array with autocomplete suggestions for the user to make it easier for them to set the timezone. I believe I could use PHP's levenshtein function to find the closest matches to the input, but was wondering if there is a better way of doing this before passing it to the script to save to the JSON config file.
     
    I would like, if possible, to first autocomplete the country, then once the backslash appears to begin matching against the locations in that country. If there is a best way to utilize alfred to do this, please let me know. If not, I can use a combo of levenshtein and conditionals I think to do it. It may not be hard to modify one line of code, but anyway to make it easier for people is better.
     
    Thanks!
  9. Like
    Amoftcoorb reacted to tamaracks in Advice on returning result of script in Alfred?   
    I had been using an extension in Alfred 1 that did conversions. I found it to be one of the most flexible extensions I found for doing conversions. It always knows what I mean.
     
    It is based on this java library: https://github.com/gnapse/metric The author of the java library originally posted the extension, but his blog is no longer online. I have been working on converting it to Alfred 2, though, and he said he didn't mind if I posted my workflow here for advice.
     
    It also does currency, but I discovered that sometime between when I began using the extension and now the provider of the currency info (OpenExchangeRates) had switched to requiring an App ID. So the versions of the workflow I'm going to post won't do currency conversion. However, I've found you can get a free App ID for personal use, so I've asked the author of the java library if he could add something that would let one pass an App ID so folks could sign up for their own. He said he would take a look. However that's not required for my question.
     
    The original extension simply called a brief bash script to pass your query to the java library and return a result to a notification. I first recreated that easily in an Alfred workflow: http://cl.ly/0J2f0A163y0Q
     
    Now I'm trying to make it return results in the Alfred window. I've actually got a version of it working already, but it could use some polishing: http://cl.ly/013j3V1L0P0X
     
    The trouble is how to handle the result when you are still typing. At first it returned errors in the Alfred window before your query was complete. Harmless, but ugly! The correct result will appear shortly after you finish typing. So far, I've managed to suppress the errors from going to stdout, so now it shows nothing for the second line if the library doesn't return a valid result. I haven't figured out how to put alternate text there, such as "Waiting for valid query" or some such.
     
    So I'm looking for advice on what I can do to provide the nicest output experience. It seems like Alfred starts calling the script shortly after you start typing following the keyword and continues to call it repeatedly as the typed query changes.
     
    As I see it, there are two options. Try to make a pause before the script kicks off, in hopes that you'd be done typing by the time it starts. However my concern is making it too long of a pause and slowing things down.
     
    Second would be to try to return some friendlier text instead of the errors. You might still get a valid result before you are finished typing. For example typing "15 g in pounds" might return "15 grams = 15 grams" if the script processes after you type the g, but it does update to the desired result when you finish typing.
     
    It's possible this is more of a bash question than an Alfred one, but I'd welcome any feedback/suggestions.
  10. Like
    Amoftcoorb reacted to R4z3r in HOW TO: Easy configuration for users [php]   
    Hey Everyone, 

    I just wanted to share my solution for using a keyword to modify an option. I added a config.json file to my workflow and require it in my script filter. This allows me easily access and modify the values.
     
    Hope it helps!
     
    See how I did it in my workflow:
    https://github.com/kkirsche/TVRage-Alfred_Workflow
     
    For mine, for time's sake, I did:
    $string = file_get_contents('config.json'); $decodedJSON = json_decode($string, true); $decodedJSON['12hrtimezone'] = true; $encodedJSON = json_encode($decodedJSON); file_put_contents('config.json', $encodedJSON);
  11. Like
    Amoftcoorb reacted to D.J. in Need help - mark all messages read (Mail.app)   
    Hi All, 
     
    I receive a lot of email notifications in different mailboxes and it's getting annoying to click every mailbox and read-all. So I want to create Alfred workflow which would do this with one action.
     
    I've found this applescript:
     
     
    So this is how my setup looks:
     

     
    I think I covered everything but it's not working. It finds the action but when confirming it, nothing happens (emails stay unread).
     
    Help will be appreciated.
     
    Thanks
  12. Like
    Amoftcoorb reacted to avirambm in Simulating a keystroke   
    Hi,
     
    My Mac keyboard is not working so well unfortunately as I spilt coffee on it. As a result, I can't invoke the "greater/lower than" keys (i.e. `<` and `>`), and I need them badly as I write a lot of HTML code. Is there a way to simulate a keystroke using Alfred's Workflow? For example, I'd love to configure a hotkey that will result in printing the `<` symbol, for example.
     
    Thanks.
  13. Like
    Amoftcoorb reacted to digital_vibe in Help with 'Open custom URL in specified browser' workflow   
    I want to create a work flow that allows me to enter a keyword and have that open multiple custom URLs in tabs. I've attempted this by starting with the 'Open custom URL in specified browser' template. I've assigned a keyword and specified the first custom URL. having done this however, nothing happens once I've used the keyword in Alfred. Additionally, while I can see how I can add further 'Open URL' actions, I can't see how to connect these to the keyword input.
     
    Any help is appreciated. Thanks
  14. Like
    Amoftcoorb reacted to gglick in Searching Multiple Online Dictionaries   
    I'm a translator, and I use several online dictionaries to look up and verify lots of different terms throughout my workday. Is there a way to make a workflow that can search all these dictionaries at once and return the results in Alfred? If there is, that alone would be worth the price of the Powerpack to me (as of now I'm still just using the free version).
  15. Like
    Amoftcoorb reacted to surrealroad in Problem generating feedback from file action   
    I have a workflow that uses a file action, that passes the file to a "Run Script" action. The run script generates XML output for feedback to show in Alfred:
     
    <?xml version="1.0"?><items><item uid="metadata-completename" arg="/Users/jack/Downloaded Media/shiveringhope07.jpeg" type="file" valid="yes"><title>Complete name</title><subtitle>/Users/jack/Downloaded Media/shiveringhope07.jpeg</subtitle></item><item uid="metadata-format" arg="JPEG" type="file" valid="yes"><title>Format</title><subtitle>JPEG</subtitle></item><item uid="metadata-filesize" arg="33.1 KiB" type="file" valid="yes"><title>File size</title><subtitle>33.1 KiB</subtitle></item><item uid="metadata-width" arg="650 pixels" type="file" valid="yes"><title>Width</title><subtitle>650 pixels</subtitle></item><item uid="metadata-height" arg="300 pixels" type="file" valid="yes"><title>Height</title><subtitle>300 pixels</subtitle></item></items> However, this feedback never shows.
  16. Like
    Amoftcoorb reacted to tonio in Script output to Terminal Command   
    Is there any way to pass a script action's output to a Terminal Command action?
     
    I'm basically trying to set a default argument if no argument is set (the keyword's argument is optional) using a script action, and then pass that to a terminal command, but I find I can't "connect" the output of the script to the input of the terminal command action.  Am I missing something?
  17. Like
    Amoftcoorb reacted to Andrew in Understanding argument types in keywords and Script Filters   
    For the last few weeks, I've been refining how optional arguments, specifically in Script Filter workflow objects work. This is now what I hope to be the final format. The most interesting one is Optional Argument with Space
     
    You can grab b64 with these changes on http://media.alfredapp.com/v2beta/ so make sure your workflow Script Filters work with below
     
    No Argument
    - You script is only run when the typed keyword is matched
    - Pressing return or tab will autocomplete keyword
     
    Optional Argument [no space]
    - Your script is run as soon as the typed keyword is matched
    - Pressing return or tab with a partial keyword will autocomplete keyword
     
    Optional Argument [with space]
    - Your script is run as soon as the typed keyword is matched, regardless of space
    - Pressing return or tab with a partial keyword will autocomplete with suffixed space
     
    Required Argument [no space]
    - Your script is run after the typed keyword is matched AND you start typing an argument
    - Pressing return or tab with a partial keyword will autocomplete keyword
     
    Required Argument [with space]
    - Your script is run after the typed keyword is matched with a trailing space AND you start typing an argument
    - Pressing return or tab with a partial keyword will autocomplete with suffixed space
     
    Cheers,
    Andrew
  18. Like
    Amoftcoorb reacted to gokubi in Alfred window pops up after running an apple script (osa) in a workflow   
    I created an applescript to interact with Outlook messages that I'm launching with a hot key in a workflow as an osascript:
     
     
    on run {}          tell application "Microsoft Outlook"                  -- listSelectedItems : a list of all items selected in Entourage         set listMessages to current messages                  -- Check to make sure items are selected, if not then quit         if ((count of listMessages) < 1) then return                  repeat with eachMessage in listMessages             move eachMessage to folder "Local Archive"         end repeat              end tell      end run   The script archives the messages as designed, but it pops the Alfred window each time. I didn't have this problem in v1 with an applescript.
  19. Like
    Amoftcoorb reacted to fruitstudios in Ejecting an External Drive   
    Hi guys,
     
    In V1 I could eject an external firewire drive which is connected to another mac (mac mini server) on our local network. This no longer works, meaning we have to screen share each time to eject this drive as the server has no screen.
     
    Working code in V1:
     
     
    tell application "Finder" of machine "eppc://userame:password@machine.local" to eject "My Passport Studio" display dialog "Ejected" buttons "OK" default button "OK"   Is there a better way to do this in V2?   Thanks,   Ben
  20. Like
    Amoftcoorb reacted to yoshindustry in Uninstall app with AppZapper   
    Hi, I am not a developer and I am completely lost with the workflows. The other day I was trying to uninstall an app with AppZapper and thought it would be cool if I could do this with Alfred. It actually work if I look for an App, select it, and open with AppZapper, but it requires a couple of steps, which could easily be avoided with the workflows (I suppose that was the idea). 
     
    So I tried to create my workflow, but impossible to get it started (I think someone who has even basic understanding of the new workflows should be able to create it in less than 2 minutes though). 
     
    So what I want is something like this:
     
    The action would be triggered when I type 'Uninstall', then I type and select the app I'd like to uninstall and press enter to open it AppZapper (for people using another uninstaller, then they could also customise the workflow to use another one, I suppose).
     
    Thank you for any help you can provide. All best, Julien
  21. Like
    Amoftcoorb reacted to GoOz in Workflow translate folder path and then open it in browser   
    Hey guys !
     
    Let me explain the situation first : I work with people on windows but i work on OSX. I often get DOS path on a shared volumes (mounted with samba) where documents i need are stored. Usually, it's .png or other graphic files.
     
    And there we are, i want to do a workflow where i type a keyword then paste the DOS path i was given; then i run a bash script that translate the DOS path to Unix path (script i already have); finally i want that new path to be open in my browser.
     
    So far, i made the input with a "keyword" then the {query} sent to a "Run script" and the new {query} sent to a "Notification". It works that way but it's not what i want.
     
    I can't figure out how to send the new {query} to the browser though.
     
    Did i miss something ?
     
    Thanks for the help
     
    GoOz
  22. Like
    Amoftcoorb reacted to yourfavorite in Running applescript to strip text formatting   
    So I have this applescript which works well when I run it in AppleScript Editor:
      set the clipboard to (get the clipboard as text)  
    However when I create a new Alfred workflow and run it, it doesn't seem to do anything.
     
    I'm using Workflows > Add > Templates > Essentials > Keyword to Script
    Then Language: /usr/bin/osascript
    All escaping turned off
     
    Any help getting this to work? Thanks!
  23. Like
    Amoftcoorb reacted to looper in Convert audio files in XLD - Workflow   
    Hey,
     
    I really love the idea of workflows, but I have no clue how to start with my first one. So actually all I want to do is open multiple selected audio files in XLD, preferably using a keyword like "Convert". Thus XLD starts converting the files automatically. Sounds simple.
     
    Since I have set up about 5 presets in XLD (like MP3 320, v0, AAC, AIFF and FLAC) it's pretty easy to change the output format with a single click. It'd be great if I could just type like "Convert into AAC" so Alfred changes the preset into AAC and passes through the audio files to XLD. However when I open the files manually XLD starts converting the files with the last used preset which means Alfred needed to open XLD first, change the preset and then open the files.
     
    If you're using XLD often you probably understand my issue. I usually use the AAC preset but it would be very handy to have access to the other presets as well.
     
    What's the best way to realize that idea? Would appreciate any help.
     
     
     
    Cheers
    looper
     
     
  24. Like
    Amoftcoorb reacted to MrMuetze in Request: DropBox upload of a .zipped File   
    Hey alfred community
    I just got used to some of the new alfred workflows and I already think about some that I would love to use. Unfortunately, I'm not the best scripter nor do I have any experience creating some of these little tasks.
    I found an older workflow that enabled me to upload one file to the dropbox public folder and copied the (shortened) url to the clipboard. My wish would be that I could also choose a folder/file or maybe a bunch of files (which wouldn't be a must have feature since the folder thing should do the job), zip that folder or that file, move it to the public folder and copy the (shortened) link to the clipboard.
    Such a workflow would just be amazing to use and I think it would be the best way to handle this little dropbox problem. The file could either be chosen by the built in Alfred Finder or a global hotkey.
     
    Thank you guys for reading that post and even thinking about if you would give it a try or not
     
    Best regards from Germany,
    MrMuetze
  25. Like
    Amoftcoorb reacted to Eliazer in search files in mounted Disk /Volumes/   
    I have a external-drive which is mounted and in Alfred V1 i was able somehow to have a shortcut to search in the context of a folder within the mounted disk...
     
    However, in V2 i have no clue how to do it..
     
    P.S. I have the power pack..
     
×
×
  • Create New...