Jump to content

dfay

Member
  • Posts

    1,054
  • Joined

  • Last visited

  • Days Won

    62

Reputation Activity

  1. Like
    dfay got a reaction from deanishe in Hours:Minutes to decimal format   
    Also if you want to go further here is a whole command-line time calculator library I wrote in python some years ago.  The code above does the conversion to minutes rather than seconds but it's basically the same as the input_time, to_seconds and base_time functionality below.
     
    def to_seconds(i): seconds=int(i[2])+(int(i[1])*60)+(int(i[0]) * 60 * 60) return seconds def from_seconds(raw_seconds): seconds=abs(int(raw_seconds)) minutes=0 hours=0 while seconds > 59: seconds=seconds-60 minutes=minutes+1 while minutes > 59: minutes=minutes-60 hours=hours+1 if raw_seconds<0: hours=hours*-1 return [str(hours), str(minutes), str(seconds)] def input_time(): time = raw_input('enter time in h:m:s format: ') time_list=time.split(":") return time_list def add(base_time): increase=input_time() return(from_seconds(to_seconds(base_time)+to_seconds(increase))) def subtract(base_time): decrease=input_time() return(from_seconds(to_seconds(base_time)-to_seconds(decrease))) def multiply(base_time, multiplier): return(from_seconds(to_seconds(base_time)*multiplier)) def divide(base_time, divisor): return(from_seconds(to_seconds(base_time)/divisor)) def milePaceToKMPace(mile_pace): return(multiply(mile_pace,0.621371)) def kmPacetoMilePace(km_pace): return(multiply(km_pace,1.609343994)) def decimal_equivalent(base_time): return(to_seconds(base_time)/3600.0) def negative(base_time): return(multiply(base_time,-1)) def display_time(i): if len (i[1])==1: i[1]="0"+i[1] if len (i[2])==1: i[2]="0"+i[2] print i[0]+":"+i[1]+":"+i[2]  
  2. Like
    dfay got a reaction from FroZen_X in Sharing Workflows I use as a Mind Map   
    I used Gemini 2 a lot about a year ago when I replaced the mechanical HD on my iMac with an SSD and 2nd HD, and cleaned up several hundred GB of photos in the process.  It worked fine for me but I switched to using SnapSelect for photos since it does fuzzy matching of similar but not identical photos.  No complaints with Gemini 2, though.  The bigger trick is to set up your work process so you don't end up with dupes in the first place
  3. Like
    dfay reacted to vitor in Video Tutorials from Alfred   
    Hello and welcome to the forums, @casadetrevino.
     
    I’m not sure you realise this, but Alfred’s entire team is officially two people. The last thing any of us want is them wasting time producing video tutorials, especially since it’s common for old features to introduce new options. In addition, since features work in conjunction with each other and not in a vacuum, videos can be pretty useless since they’ll just be showing the same you can read by looking at the feature itself.
     
    Also, I believe you overestimate the desire for video tutorials. Just as you think they are loved, they are equally hated. It’s common for power users (who Alfred targets) to loathe video tutorials.
  4. Like
    dfay got a reaction from deanishe in Clipboard "filters"   
    Take a look at these for examples of how to proceed:
     
    https://www.alfredforum.com/topic/2180-case-converter-including-title-case/#comment-12226
     
    https://www.alfredforum.com/topic/4818-code-case/#comment-29475
    (this may be the best model if you want to be able to preview the output)
     
    Also this one that I use but which never posted:
     
    https://dl.dropboxusercontent.com/u/6601556/Alfred/Text cleaners.alfredworkflow
  5. Like
    dfay reacted to deanishe in how to create a workflow for actions within alfred itself   
    Generate an alfred://customsearch/ URL.
     
    To see one, double-click on a Web Search and click "Copy URL for sharing". Here's the Custom Search URL for my TheTVDB.com Custom Search:
    alfred://customsearch/Search%20TheTVDB.com%20for%20%27%7Bquery%7D%27/tv/utf8/nospace/http%3A%2F%2Fthetvdb.com%2F%3Fstring%3D%7Bquery%7D%26searchseriesid%3D%26tab%3Dlistseries%26function%3DSearch To install the search, open the URL (with an Alfred Open URL action or open alfred://customsearch/... etc.)
     
  6. Thanks
    dfay got a reaction from mcouthon in Apple Music workflow with Love   
    create a trigger that connects to the following applescript:
    tell application "iTunes" set loved of current track to true end tell This didn't used to work with Apple Music, but it does now.
     
    Adding an Apple Music track throws up error "iTunes got an error: current track doesn’t understand the “add” message." number -1708 from current track
     
    So that's not easily possible at the moment.  
  7. Like
    dfay got a reaction from jrg_1411 in Alfred can't find any applications   
    What version of OS X are you running? (haven't seen that much Lucida Grande in a while...).  Alfred requires 10.9 (Mavericks).
  8. Like
    dfay got a reaction from vibesonthedrums in Alfred access to touch bar? (for workflows or search results)   
    Has anyone looked at the new APIs to see if this would be possible?  I'd love to be able to throw a menu of actions onto the touch bar rather than relying on modifier keys.
  9. Like
    dfay got a reaction from ghui in Is there a way to notify user to do some config just after the workflow was installed.   
    Another option is to have the user run a separate configuration workflow - see 
    for an example
  10. Like
    dfay reacted to Stefan64 in macOS Sierra broke all my workflows   
    yeah, right, should have known better, thank you!
  11. Like
    dfay got a reaction from Stefan64 in macOS Sierra broke all my workflows   
    You mean like the workflow debugger?
  12. Like
    dfay reacted to vitor in Can anyone explain this to me?   
    I did take my precautions. I went to the image from imgur instead of directly clicking. It did occur to me it may have been a specific compromised page on imgur, though.
  13. Like
    dfay reacted to deanishe in Latest Alfred Tutorial   
    Time to get passive-aggressive and submit a tutorial on how to convert smart quotes to dumb ones.
  14. Like
    dfay got a reaction from cands in Yosemite Dark Mode Toggle (With Alfred Theme Toggle)   
    My latest updates for TaskPaper 3 and OmniFocus:
    do shell script "cd '/Users/username/Library/Application Support/TaskPaper/'; cat day.less > theme.less" tell application "OmniFocus" set value of preference id "OFIColorPaletteIdentifier" to "builtin:OmniFocus Light" end tell Same code but with night.less and OmniFocus Dark for night.  You need to create a day.less and night.less TP3 theme.
  15. Like
    dfay got a reaction from Terry T. in Case Converter (including Title Case) - now working on MacOS 12.3   
    Updated March 26, 2022 to use Python 3 for MacOS 12.3 
     
    Now featuring Universal Action triggers and hotkeys for the following five actions:
     
    Uppercase
    Lowercase
    Capitalize - capitalizes all words (e.g. Posting A New Topic In Share Your Workflows)
    Title Case - capitalizes word except for "the", "in", "of" etc. according to American English title conventions (e.g. Posting a New Topic in Share Your Workflows)
    Sentence Case - capitalizes only the first letter of the first word & converts the rest to lower case
     
    All of these are set to Copy to Clipboard and Paste by default.
     
    There's also a script filter cc which lets you view the query converted and select your choice (like the Code Case workflow).
     
    You can also connect a hot key directly to the cc script filter directly to view the output options without typing the cc command and pasting your text.
     

     
    Download:
     
    https://www.dropbox.com/s/8fydkkef1t699et/Case Converter 3.alfredworkflow?dl=0
     
    NB This is a new link and will download as a new workflow - you'll need to migrate any hotkeys and delete or disable the older version.
     
    Here's the old Python 2 version in case anyone wants it:
     
    https://www.dropbox.com/s/3k2lh21g5wnqrkp/Case Converter 2.alfredworkflow?dl=0
     
    The original version is described below and still available, if anyone prefers it.
     
    Workflow Version:
     
    This workflow converts the case of the text on the clipboard.
     
    http://dfay.fastmail.fm/alfred/Case%20Converter.alfredworkflow
     
    There are two workflows which display the following five options:
     
    Uppercase
    Lowercase
    Capitalize - capitalizes all words (e.g. Posting A New Topic In Share Your Workflows)
    Title Case - capitalizes word except for "the", "in", "of" etc. according to American English title conventions (e.g. Posting a New Topic in Share Your Workflows)
    Sentence Case - capitalizes only the first letter of the first word & converts the rest to lower case
     
    The keyword case will transform the text on the clipboard without pasting the result.
    The keyword casep will transform the text on the clipboard and paste (using Applescript System Events)
     
    Hotkey Version:
     
    Here is a version for use with hotkeys which will operate on the active selection in OS X and paste it with the converted text.  These all have a half second delay prior to pasting, which is necessary for Applescript to be able to paste.
     
    http://dfay.fastmail.fm/alfred/Case%20Hotkeys.alfredworkflow
     
    Notes and Revision History:
     
    These use the Title Case perl script found at https://raw.github.com/ap/titlecase/master/titlecase .
     
    If you manage academic citations with BibDesk, Zotero, Papers, Mendeley, etc., Title Case conversion is especially useful for cleaning up downloaded citations.
     
    Updated May 3, 2013 with nicer colored icon thanks to mjv ( http://www.alfredforum.com/user/4384-mjv/ )
     
    Updated February 5, 2014 to handle Sentence Case and to add a second keyword to paste after conversion.
     
    Updated May 20, 2014 with hotkeys
  16. Thanks
    dfay got a reaction from nemrod in Case Converter (including Title Case) - now working on MacOS 12.3   
    Updated March 26, 2022 to use Python 3 for MacOS 12.3 
     
    Now featuring Universal Action triggers and hotkeys for the following five actions:
     
    Uppercase
    Lowercase
    Capitalize - capitalizes all words (e.g. Posting A New Topic In Share Your Workflows)
    Title Case - capitalizes word except for "the", "in", "of" etc. according to American English title conventions (e.g. Posting a New Topic in Share Your Workflows)
    Sentence Case - capitalizes only the first letter of the first word & converts the rest to lower case
     
    All of these are set to Copy to Clipboard and Paste by default.
     
    There's also a script filter cc which lets you view the query converted and select your choice (like the Code Case workflow).
     
    You can also connect a hot key directly to the cc script filter directly to view the output options without typing the cc command and pasting your text.
     

     
    Download:
     
    https://www.dropbox.com/s/8fydkkef1t699et/Case Converter 3.alfredworkflow?dl=0
     
    NB This is a new link and will download as a new workflow - you'll need to migrate any hotkeys and delete or disable the older version.
     
    Here's the old Python 2 version in case anyone wants it:
     
    https://www.dropbox.com/s/3k2lh21g5wnqrkp/Case Converter 2.alfredworkflow?dl=0
     
    The original version is described below and still available, if anyone prefers it.
     
    Workflow Version:
     
    This workflow converts the case of the text on the clipboard.
     
    http://dfay.fastmail.fm/alfred/Case%20Converter.alfredworkflow
     
    There are two workflows which display the following five options:
     
    Uppercase
    Lowercase
    Capitalize - capitalizes all words (e.g. Posting A New Topic In Share Your Workflows)
    Title Case - capitalizes word except for "the", "in", "of" etc. according to American English title conventions (e.g. Posting a New Topic in Share Your Workflows)
    Sentence Case - capitalizes only the first letter of the first word & converts the rest to lower case
     
    The keyword case will transform the text on the clipboard without pasting the result.
    The keyword casep will transform the text on the clipboard and paste (using Applescript System Events)
     
    Hotkey Version:
     
    Here is a version for use with hotkeys which will operate on the active selection in OS X and paste it with the converted text.  These all have a half second delay prior to pasting, which is necessary for Applescript to be able to paste.
     
    http://dfay.fastmail.fm/alfred/Case%20Hotkeys.alfredworkflow
     
    Notes and Revision History:
     
    These use the Title Case perl script found at https://raw.github.com/ap/titlecase/master/titlecase .
     
    If you manage academic citations with BibDesk, Zotero, Papers, Mendeley, etc., Title Case conversion is especially useful for cleaning up downloaded citations.
     
    Updated May 3, 2013 with nicer colored icon thanks to mjv ( http://www.alfredforum.com/user/4384-mjv/ )
     
    Updated February 5, 2014 to handle Sentence Case and to add a second keyword to paste after conversion.
     
    Updated May 20, 2014 with hotkeys
  17. Like
    dfay reacted to Adam Wolski in Climbing grades converter   
    I present you the workflow for converting different climbing grades systems. Any feedback is welcome.
     

     
    Download | Source
  18. Like
    dfay reacted to Awfki in Mass Create Snippets   
    Googling alfred json snippet turned up this python script which worked wonderfully.
     
    The script works in Python 2.7, didn't work with Python 3.5.  After formatting your CSV and running the script you'll have a bunch of .json files.  Zip all those up and name the file Collection.alfredsnippets and then open the file (cmd-down arrow).  Alfred will import the snippets into "Collection" (you can name that whatever you'd like) and WILL OVERWRITE IT if it already exists.
     
  19. Like
    dfay reacted to Awfki in Snippets - allow batch editing/importing   
    Thank you!  I was trying the same thing and finally Googled alfred json snippet and found this.  Worked great. Python 2 for anyone else using it.
     
  20. Like
    dfay got a reaction from netnothing in Launch apps/file workflow paths on different machines   
    For future reference to anyone interested, here's how I solved this problem in AppleScript, in this case to run different Chronosync documents per machine.  (In addition, I have a post-run script set up in Chronosync that updates a file in Dropbox indicating which machine the sync last ran on, and a Script Filter in Alfred that displays this status as a subtitle - can post if anyone's interested).  
     
    set theComp to computer name of (system info) tell application "ChronoSync" if theComp contains "MBA" then open "/Users/username/Documents/archive/MBA to MyUSBStick.sync" else if theComp contains "iMac - work" then open "/Users/username/Documents/ChronoSync Documents/MyUSBStick Documents <> iMac - work.sync" else if theComp contains "MBP" then open "/Users/username/Documents/archive/MBP to MyUSBStick.sync" else if theComp contains "Mac Mini" then open "/Users/username/Documents/ChronoSync Documents/Mac Mini to MyUSBStick.sync" end if Trial Sync document 1 end tell  
  21. Like
    dfay got a reaction from deanishe in Workflow Request: Searching sections/bookmarks in pdfs   
    I just looked at the metadata on an existing pdf (using mdls , the command-line program to access Spotlight metadata) then added a bookmark in Preview to that PDF, and looked at the metadata again.
     
    The bad news is that Preview isn't saving the Bookmarks as metadata - they're encoded directly in the PDF....so you would need to use a tool like pdftk to read the bookmarks ... but you don't want to do that for each file each time you search....so you'd need to cache it....
     
    The other option is to use Skim and have it save separate skim notes files - this won't save bookmarks per se but it will create searchable files with all your annotations -- see http://apple.stackexchange.com/questions/41013/is-there-a-way-spotlight-indexes-my-skim-bookmarks-notes. (There's also a preference in Skim to make it create the Skim notes files by default).
     
    Having said that I've got a library of +/- 8000 PDFs and in 12 years with Skim I don't think I've ever searched my annotations directly -- they all end up in a BibDesk database and I search the accompanying bibliographical records instead.  BibDesk allows the option to search within Skim notes (same developers), which works great on the rare occasions when I need it.
     
    The pain with Skim is that if you're round-tripping to iOS you need to regularly be converting Skim notes to standard PDF annotations and vice versa.  (This actually has got me thinking about dropping Skim, but there's nothing else I've found that is as customizable or scriptable.  Even though @smarg19's Skimmer workflow hasn't been updated in ages....).  If someone could write a cross-platform PDF editor that has a URL scheme that allows linking and indexing of annotations on iOS and MacOS I'd buy it in a second.
     
    Following-up - it looks like the developers of Skim and BibDesk have ruled out searching standard (i.e. non-Skim) PDF annotations precisely because they are not included in metadata - see https://sourceforge.net/p/bibdesk/feature-requests/760/
     
     
  22. Like
    dfay reacted to marlowe in TaskPaper3 Workflow for Alfred   
    This is a huge help. I had a lot of Applescripts I made for Taskpaper 2 and Alfred that broke when I upgraded to 10.12, and even though I had upgraded to Taskpaper 3, I was missing a lot of the efficiency I had before due to the loss of my workflows and not having the time to invest yet in relearning how to automate Taskpaper 3. This workflow is great. Thank you for sharing it!
  23. Like
    dfay got a reaction from nikivi in Alfred access to touch bar? (for workflows or search results)   
    Has anyone looked at the new APIs to see if this would be possible?  I'd love to be able to throw a menu of actions onto the touch bar rather than relying on modifier keys.
  24. Like
    dfay got a reaction from deanishe in Use alfred to observe contents of "All my Files"   
    @deanishe That command ins't exactly the same as what was in the recentitems plist ....it returns recently modified as opposed to recently opened files.
     
    but 
    mdfind -onlyin $HOME '((kMDItemLastUsedDate > $time.now(-360m)) && (kMDItemLastUsedDate < $time.now()))' | grep -v /Library/ does the trick (I changed the time from 60 min to 360 min).
  25. Like
    dfay reacted to robwalton in TaskPaper3 Workflow for Alfred   
    I can see why you wouldn't want to do it a second time! Just noticed TaskPaper 3.5 has been released. Hopefully it will all still work right.
     
    I found the Javascript part of JXA okay---it has some oddities but not too bad and way easier to write than Applescript. Also TaskPaper's API where you evaluate code inside it is pretty easy to work with. However, the Apple automation bit of JXA is seems pretty hit and miss. Things that would work in Applescript sometimes don't in JXA or bits are missing; but the good thing about JXA is you can use objective C which seemed to work well.
     
     
×
×
  • Create New...