Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Posts posted by twinpeaks

  1. So I am trying to search the clipboard history of alfred by date. I remember copying something on a certain day and can pull that up but can't pull up things I copied around that date and time. Any help? I tried opening the database with bbedit and was pretty jumbled. If this is possible and answered please forgive the duplicate but if not, any help would be much appreciated. Cheers!


    if you want to add it, writes safari's tabs to frontmost foldingtext window or opens the app if necessary.

    -- All code grabbed and requested help with from generous parties and unsuspecting github users.
    -- Create Markdown link from front most tab in safari and append
    -- to end of current FoldingText document as new list item.
    on alfred_script(q)
    --on run
    	-- -- -- -- -- -- -- -- --
    	-- i.e. path from "go to file" or clintxs' "getCurrentDocument()"
    	-- -- -- -- -- -- -- -- --
    	-- https://gist.github.com/Zettt/1081322
    	-- Inserts rounded time (15 minutes). Can be called from, e.g. TextExpander. (AppleScript version)
    	-- AM/PM script by - http://forums.macrumors.com/showpost.php?p=9845114&postcount=2
    	set currentHour to hours of (current date)
    	set currentMinute to minutes of (current date)
    	set pre to "AM" -- AM/PM script addition
    	if (currentHour > 12) then -- AM/PM script addition
    		set currentHour to (currentHour - 12) -- AM/PM script addition
    		set pre to "PM" -- AM/PM script addition
    	end if -- AM/PM script addition
    	if (currentHour ≥ 0) and (currentHour < 10) then
    		set currentHour to "0" & currentHour
    	end if
    	if (currentMinute ≥ 0) and (currentMinute ≤ 7) then
    		set currentMinute to "00"
    	else if (currentMinute > 7) and (currentMinute ≤ 23) then
    		set currentMinute to "15"
    	else if (currentMinute > 23) and (currentMinute ≤ 37) then
    		set currentMinute to "30"
    	else if (currentMinute > 37) and (currentMinute ≤ 52) then
    		set currentMinute to "45"
    	else if (currentMinute > 52) then
    		set currentMinute to "00"
    		set currentHour to currentHour + 1
    		----Get "AM or PM"
    		--set Pos to offset of " " in timeStr
    		--set theSfx to characters (Pos + 1) through end of timeStr as string
    		return "Error"
    	end if
    	-- return (currentHour as string) & ":" & (currentMinute as string)
    	-- -- -- -- -- -- -- -- --
    	-- -- -- -- -- -- -- -- ----
    	set time_stamp_rounded to (currentHour as string) & ":" & (currentMinute as string) & (pre as string) -- & " " & (pre as string) -- AM/PM script addition
    	-- return time_stamp_rounded
    	set the date_stamp to (short date string of (current date))
    	set parentText to ("# ") & time_stamp_rounded & " - " & the date_stamp & return & ("### Safari Tabs") & " - " & " @ta	g1" & return
    	## ") & time_stamp_rounded & " - " & the date_stamp & " - " & ("Safari Tabs") & " @linklist" & return
    	set MDLink to ""
    	tell application "Safari"
    		set safariWindow to window 1
    			repeat with t in (tabs of safariWindow)
    				set TabTitle to (name of t)
    				set TabURL to (URL of t) as text
    				set MDLink to (MDLink & (" - [" & TabTitle & "]" & "(" & TabURL & ") ") & return)
    			end repeat
    		end try
    	end tell
    	tell application "FoldingText"
    		tell front document
    			evaluate script "function(editor, options) {
                    var tree = editor.tree();
                    var range = tree.createRangeFromLocation(tree.textLength(), 0);
                    tree.replaceTextInRange(range, options.link);
                }" with options {link:(parentText & MDLink)}
    		end tell
    	end tell
    --end run
    end alfred_script
  3. This script is great but way too hotkey intensive for me to use as much as I'd like.


    - Anyway to get a scriptfilter set to optional? Start typing and you filter down the list to the command your looking for but in this way not necessary to remember the variables or the hotkeys as they are listed automatically in alfred's menu...


    That would make this so much more useful for me. I will play around some more and see if I can get it working off the example of another workflow but I tried before and got discouraged so I'll let you know but 1+ days you can be sure I have threw in the towel. Cheers!

  4. Save Link does one thing and does it pretty well but remember this workflow was also coded when Alfred v2 was in beta testing. Hell no excuses, I like this workflow and still use it. Anyways, don't ask me for features as I was the recipient of this little guy when I asked for a feature addition to SendURL - Coded generously by Jonas Erikson so don't ask me for any additions as I can't help myself let alone you. ;)


    Quick break down:

    - "Later" is the keyword which populated the subtext with the url of the site your adding/viewing.

    Save, Link, Workflow, Tag, and, okay - 5 tags I have given the page.






    output to your file is written as:

    [Posting New Topic - Alfred App Community Forum](http://www.alfredforum.com/index.php?app=forums&module=post&section=post&do=new_post&f=3) #2014-05-27 #Save #Link #Workflow #Tag #okay

    links - keyword to browse list and modifiers offer the ability to remove saved links, send them to instapaper mobilizer and no duplicates ever as you can update the tags of an already saved website by revisiting the site and entering new tags.





    Perfect workflow besides a few minor personal aesthetic choices


    **Features I'd enjoy:** Save browsing sesssion, Lots of tabs all grabbed and written to their own file. As seperate files sessions could be invoked and browsed by their date or theme/tag and if selected then "Drill Down" into the specific saved session of tabs to see which sites it contains .


    That's about it. Thanks and sorry for the crappy run down as you can tell I do not share much ... 


    Download: http://www.datafilehost.com/d/373c22e4


  5. What is to be gained here?

    @Florian, straight to the point while still confusing! What is to be gained from the workflow or gained from beta testing? Either way, I needed the laugh.

    - You gain a better workflow, maybe someone who can provide feedback and fixes on your workflows along with some good karma. 


    @ Tyler Eich - I think you blew everyone away with colors 1.0, I am glad to see your challenging yourself and not resting on your laurels so to speak. +1 for sharing the results of your hard work with us and even allowing open participation for sought after features, those which you haven't found a use case for at least. This workflow takes the cake for number of "connectors," even the guts are aesthetically pleasing. Again, thank you for keeping us leeches in your thoughts and I'll attempt to give some feedback if anything appears out of order, both appearance wise and functionality.

  6. Okay a bit confusing with the snippets all doing different tasks. Here is a solution that will


    - Give you a prompt asking where the webloc file should be saved (it is here that you can move around and save it to a different directory)

    - The name of the file to be saved is pre-populated with the name/title of the browser window.

    tell application "Safari" to set thename to name of front document
    tell application "Safari" to set theUrl to URL of front document
    tell application "Finder"
    	set resultFile to (choose file name with prompt "Save As File" default name thename default location path to desktop) as text
    	--	if resultFile does not end with ".webloc" then set resultFile to resultFile & ".webloc"
    	make new internet location file to theUrl with properties {name:thename}
    end tell

    I need more info and clear info if this does not work. Please clear up if you want to use Safari or Chrome as they have different methods of grabbing browser info, just wording changes but it matters.


    You do want webloc files correct? I am super confused by the last script where you have it save the url to a .url file prefixed with `[internetShortcut]URL=`

    (the shell in that script is doing nothing but taking the url passed to it and adding the [internetShortcut]URL= to it URL)


    Please let me know if I missed what you needed completely, what is wrong, items to change, ideally could use...  

  7. Thanks again for doing all the heavy lifting! Definitely do not bother with the hotkey phantom bug and I say that as there could be a plethora of other reasons I ran into the problem of one hotkey working while another attached to the same script failed. If I have some time soon I will make a thorough test of the "problem" and report any notable results. I am still on 10.8.5 so maybe it is that, enough with the speculation though and I have nothing more to go on as I truly haven't attempted to reproduce the effects, or lack thereof an actions menu being called up by the key code(s). I have it working so I am happy whatever I changed, possibly the very well hidden hotkey trigger options, but I can't say for certain and to make it a bit murkier I do not know what the real differences of the options are although I am glad you learned of a new feature to take advantage of in your current and future workflows.


    If I think of anything mind blowing, doubtful, I will shoot you a message. I have always been "bothered" by unsaved docs, especially temporary scratch pad type text documents I seem to accumulate. I have to really think this out as I have no idea what this feature of the workflow's end goal would be let alone accomplishing it so if I iron out anything that makes sense hopefully I can translate my intention.


    Okay, Throwing it out very quickly absolutely no thought given to it other than the last few minutes, my disclaimer of sorts. Anyways, say the user has a temp textedit file open and they want to save the file with a title based on the first sentence of the file, say everything before the first punctuation mark becomes the title and it is saved in a folder under the bundle identifier of the app that "saved" it. If no front window is open/showing but the app is running feeding alfred a list of the files to choose form or action when ready m


    no, no, no - absolutely nothing to do with the intent and purpose of this workflow. Let me think about it! Thanks again for all the help, Cheers!

  8. There you go teaching me something new again. I have hazel set to Archive downloaded files every 3-4 days and then sort them by by date added in ~/downloads/archives/* and your right. The workflow is perfect now that the file was moved/archived by hazel but I guess ignorance with a bad archiving setup combined with bad luck of having a couple days left before the downloads get sorted into daily folders left me thinking I had a major problem.


    Long story short, I appreciate you taking the time to reply with this golden nugget of knowledge. I honestly probably would never, at least not until I finally use Mavericks full time, have given the workflow another short or tried to remedy the problem. Luckily it was a problem that was ultimately easy to fix and mostly perceived as a problem even when it was no longer affecting the workflow. 


    Thank you sir for the specific help related to my problem above, pretty good when you don't even have to fix anything just told me to give it another shot. Workflow magic?Anyhow, you do deserve a huge thanks for keeping your workflows in pristine shape, source and zipped workflows are updated constantly for minor fixes and lots of large ones. Always enjoy receiving those notifications. Cheers and keep claiming the "most updated repo of alfred workflows known to man." Take it easy bud.

  9. Finally figured out what was going on, at least in my case but you will be able to confirm with your settings. I had multiple hotkeys for each script, I know, a bit much but so darn useful it deserves more! Anyways, with those key codes being called with system events in the same script only one hotkey was actually pulling up file action menu while the other stopped at the selected file. I thought pulling up the selected file in the file browser was the intent until I read your post over with a little attention being spared.


    If you have the hotkeys configured to "Pass Through Modifier Keys (Fastest)" which is not the default but rather the third option after double clicking the hotkey cell and then control click on the actual hotkey combination. I usually always get rid of the default "Simulate modifier keys" and throw in the fastest option so it was not until I swapped their behavior until realizing that the modifiers alfred was simulating was causing the file action to never get invoked.


    Default right arrow shouldn't witness these problems but perhaps you have yours set this way once you build and share the workflow as they are working with standard settings offering to simulate modifiers by the time i download the workflow.


    Either way, all is well and I have a new most used hotkey, two of them! Thanks again and if you do not see any reason why having the alfredfinder,scpt hotkey to have it's default option be to skip/pass through modifiers it might save some people a headache wondering why it doesn't work or going on thinking that the file action has to be invoked manually if they do not use the right arrow as an action key.


    I am glad you put this idea into the workflow, A hotkey for bringing me to the file where I can manually glob search the directory after hitting delete or invoke the file action with control or function. Two hotkeys inevitably helped me find the problem, now they will be the problem when I can't remember anything and every accidental key stroke invokes a random script tied to alfred triggers.

  10. Yeah, both are useful if your drowning in workflows but after working with both for awhile you will decide that it may just be best to backup all your workflows and Alfred's current preferences and state and then re-install only the very useful ones, defining useful is the hardest part.


    And now for my workflow idea:


    Nothing flashy happens and it pretty much would only show results in alfred once it has had time to observe how you use workflows but pretty much this OG statistician workflow would automatically report back with simple in-line feedback with numbers relating to each section. For instance,

    10 - Used Today

    16 - Used In The Last 7 Days - 8 of the 16 were used outside of today.

    25 - Used in the last month


    Wow, it seemed like a great idea when I started but after thinking of the feedback I am not so sure about this anymore lol. Anyways, it dawned on me that having some nice usage specific to workflows would help a lot of us remove and not just disable those workflows we don't use. 


    And now I believe Alfred 2 should have a "backup workflow" type of feature as well in the context menu, say next to export workflow menu option. Sure, exporting is good, no it's great, those days of manually entering everything was no fun at all.


    Anyhow, I tend to disable a lot of workflows I don't think i have a use for but I feel if I delete them then the scenario where they can be used will pop-up and if i'm not on ym local machine that has my old alfred workflows folder locally that doesn't sync and isn't stored along side alfred's data so it all's nice and organized I can't access them and so I feel better to just disable and end up with more workflows than minutes in the day.


    Not recommend but you can always do this manually, create a filter if you want and accomplish the goal of knowing that your unused workflows are being saved into a dedicated directory either in Alfred 2's application support directory or the folder that masquerades as a file, Alfred.alfredpreferences... Solution created by you and not officially sanctioned, but still works - perhaps people would use this. I really do not know if I would but I know that I have too many workflows and just thought about this after remembering when I believed the two mentioned above would shame me into trimming the fat.


    Nothing gets trimmed and those workflows, Mr. Rice's "Help" specifically is the only one that ever sees the light of day and that is to find which workflow is holding a hotkey combo I want to use hostage.

  11. Wow, I really need to make sure I am not simply reading the last post ever again. Sorry I missed the initial response so this is the third time I start over since I raise and/or answer items no longer relevant. I'll make this quick if your still around.

    - Most important, thank you! I appreciate you taking the time to consider and better yet adding the feature to the workflow. I hope others find it as useful as I do.


    - As you can tell... Yes, you hit the functionality I was hoping to have implemented or thought could be useful dead center.


    - Everything is fast and solid but I use either function or control not the right arrow button to bring up the file action pane. I found a resource of keycodes and plugged both in there but control and fn are not receiving the same kind of love as the default ➡ key does and so I am going to play with it for a bit and see if I can get it working and most likely need to delay it a bit more.


    Find keycode chart here but you can find them with lots of one trick third pony applications. I believe I remember terminal responding with key codes in the past. ..



    Again, thanks for implementing the feature and taking it a step further with the action panel being invoked automatically by the applescript. That is really the end result most of us are hoping to achieve so this is great, I just need to get my setup (function(fn) and control modifiers to work. Definitely should so let me not take up more of your time unless I simply have racked my brain and still am receiving only the file path with file selected.

  12. This is really useful. I also appreciate the rewrite as splitting actions up into separate scripts has made it much easier to modify and understand. 


    Most likely already implemented in one way or another but I wanted to make a quick addition to the workflow and replicate the very useful "Get and Browse document in Alfred" workflow but using the template you created. so I had everything in one workflow. It would take you 10 seconds to put this together yourself but perhaps you don't want it or just forgot about revealing in alfred's file browser. 


    Hopefully someone finds it useful, only takes you to the directory and can't select the file for you like the workflow can in Finder, new feature of latest update and my favorite.

    on run theType
    	-- get path to frontmost document
    	tell application "Finder" to set dir to POSIX path of ((container of (path to me)) as alias)
    	-- if theType as string is "MS" then -- different loading script if user has MS Office
    	--	set pathscript to load script dir & "pathMS.scpt"
    	-- else
    	set pathscript to load script dir & "path.scpt"
    	-- end if
    	set p to getPath() of pathscript
    	-- open in finder
    	tell application "Alfred 2" to search p
    end run

    I do not think this warrants a pull request but I am sure it can be more robust. Would you use this addition to your workflow or have you already strung a couple of scripts together for this functionality and the ability to use Alfred 2's wildcard support? Thanks again for posting this here and maintaining a repo of workflows so updates are easy to stay on top of. 

  13. You have compiled a hit with this one! No it's not as informative or comes out of the box providing users with lots or any configs as recent downloads by ddjfreedom does but it is capable of taking on arguments or follow-up scripts and is much faster and more accurate. Clinton Strong made the afformentioned workflow 100% faster and added  awesome enhancements like % complete for safari downloads. However, if I had to choose one workflow and never receive another update, yours wins no question. I know this workflow is never breaking down which is half/all my fault for not being capable of fixing ruby scripts.


    I had to get that out there and scold everyone who has downloaded this and not posted a quick thanks or tapped the button. We wonder why so many great scripters have gotten fed up with fixing scripts and sharing new creations with this board... SWC, I am going to check out your other workflows in a moment and keep a backup of this script filter for safe keeping. 



    By the way, would you consider creating a github repository of all your workflows since the number is staggering? If you prefer not would you care if I did and simply had you email updates or new workflows to be posted? Don't get discouraged by the lack of appreciation, we are a very spoiled group here and it's going to bite us in the ass even more than it already has.

  14. I think my most used workflow is telling me to upgrade to Mavericks already! I was running smooth for so long with this workflow and Mountain Lion (10.8) - Still haven't upgraded but at least the error output is consistent against all the builds I have tried. 


    ❯ /usr/bin/ruby recent_downloads.rb " "
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/date/format.rb:1055:in `dup': can't dup NilClass (TypeError)
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/date/format.rb:1055:in `_parse'
        from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/time.rb:240:in `parse'
        from recent_downloads.rb:65
        from recent_downloads.rb:6:in `map'
        from recent_downloads.rb:6:in `each'
        from recent_downloads.rb:6:in `each_with_index'
        from recent_downloads.rb:61:in `each'
        from recent_downloads.rb:61:in `each_with_index'
        from recent_downloads.rb:61:in `each'
        from recent_downloads.rb:61:in `map'
        from recent_downloads.rb:61

    Mr. Clinton Strong, if you have a spare minute in the next few weeks and it's truly not much work to solve this error I would greatly appreciate the help or any advice.


    I have no clue where to start considering I did not upgrade my OS, still using 10.8 and it's linked to system ruby... weird because even throwing homebrew's ruby in the default path of `/usr/local/bin/ruby` I receive the same error and it's ruby 2.0.0p353 (2013-11-22 revision 43784)  so the utf-8 error you mention I thought might be good to go with that version but similar error, I am sure totally different but they look similar to me..

    ❯ /usr/local/bin/ruby recent_downloads.rb " "
    /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/2.0.0/time.rb:325:in `_parse': no implicit conversion of nil into String (TypeError)
        from /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/2.0.0/time.rb:325:in `parse'
        from recent_downloads.rb:65:in `block in <main>'
        from recent_downloads.rb:61:in `each'
        from recent_downloads.rb:61:in `each_with_index'
        from recent_downloads.rb:61:in `each'
        from recent_downloads.rb:61:in `map'
        from recent_downloads.rb:61:in `<main>'

    Anyways, thanks  and so I am not a complete mooch I will attempt to help the folks wanting the window to stay open after file deletion action modifer script...and my answer , albeit ill-advised answer would have to be no, you can't have the window stay open after an item is deleted but you could probably have it quickly flash by pre-populating an applescript, via osascript... tied to run after the rm recursive script...


    I would imagine tying that to a variable  to run with quickly thrown together NOT tested but could work (just use a hotkey) but maybe this will get you started...

    tell application "Alfred 2" to search "recent"

    through osascript and bash... I know there are tons of variants, this template has worked in the past for me, hope it helps I would recommend a hotkey as it is much easier, more reliable, native, and very fast as the route to go.

    showAlfred=`osascript <<END
    tell application "Safari" to set theURL to URL of front document
    tell application "Alfred 2" to search "recent"
    end try
    end tell
    rm -rf {query} && $showAlfred

    3rd time, i repeat, not tested but shouldn't be "dangerous" but recursive remove command is a bit scary so I hate to have anybody lose work because I falsely represented this as a proper solution.

  15. Sorry for the lame question but do I need anything extra for this to work? Because when I type gs, Alfred will just show me the normal google search, with no previews.

    ? I don't have this workflow but I do not see any previews in the screenshot... I would be very surprised this thread doesn't have 100+ replies if the workflow really showed previews of the results. I think your getting all there is to get. Sorry I can't give you anything solid... hope this helps a bit.

  16. Download links broken or expired?

    Yup, luckily the code is on github and I would recommend packaging the original source so you know that nothing has been tampered with by a 3rd party but as a general note all workflows created by others should be inspected before running. Anyhow, with that in mind I won't package the workflow up for you as there are a few different ways I have seen that done and don't know how alfred does the zipping. As a general rule they are simply zip archives so unzip for source and zip swapping extensions for .alfredworklow.


    1) Download an archive of the repository from github and unzip, you should be left an "alfred-pinboard-master" directory: 


    2) Open up terminal and change your working directory to your ~/Downloads folder or wherever you saved the archive and subsequent folder 

    cd ~/Downloads

    Run the below zip command to stuff it all together

    zip -j9 --filesync pinboard.alfredworkflow alfred-pinboard-master/*.{json,js,png,plist,md}

    The markdown, md, file doesn't need to be included in your workflow but it does not matter and some info can't hurt. You should be good to go after that importing pinboard.alfredworkflow. The workflow file name is generic, whatever info the original poster/creator left in the workflow's details will hold.





  17. -  In an empty workflow press the "+" in the top right of the sheet. From the drop down select "Actions" -> "Run Script"

    -  in the new bloc that shows up, double-click and select language to the use the /usr/bin/osascript interpreter.

    -  Leave all escaping options alone (checked/selected) and paste the following script into the appropriate area.


    Now add a hotkey field with the "+" button again, Select "Triggers" and then "Hotkey"

    Double click the new hotkey bloc and put in a combination. After that connect the two items. Hotkey----->Run Script


    See the credits link in the first post? http://shawnblanc.net/2011/06/oopsiefocus/ 


    The script is verbatim from shawn's site and no modification was necessary to make it work with Alfred. Should be good to go. No work, no problem. 

    set GTDAppName to "OmniFocus"
    global GTDAppName
    set GTDAppToUse to FindRunningGTDApp()
    if (GTDAppToUse is null) then
    	set GTDAppToUse to "OmniFocus"
    end if
    -- Is OmniFocus running?
    on AppIsRunning(GTDAppName)
    	tell application "System Events"
    		return (count of (application processes whose name is GTDAppName)) is not 0
    	end tell
    end AppIsRunning
    -- If OmniFocus is running, do nothing.
    -- If OmniFocus is not running, launch it and bring up the Quick Entry Panel.
    on FindRunningGTDApp()
    	if AppIsRunning(GTDAppName) then
    		tell application "OmniFocus"
    			tell quick entry
    				make new inbox task
    				tell application "System Events" to keystroke tab
    			end tell
    		end tell
    	end if
    	return null
    end FindRunningGTDApp
  18. Gotta say, I am super impressed with patience and vision for the workflow. You made it so you could profit but you've kept making it better for everyone here who needs(wants) it to function a certain way. All in all it does a very good job and descriptions put it over the top in the usefulness category. I haven't tried the unread feature but I am sure that one will be another handy gem. Many thanks for staying active on this. Was super reliable and quick since your first post here but it has gotten better over time with the last few days seeing the best additions imo. Keep it up! I hope you still like it!

  19. I was under the impression that you could even change the folder name to a custom name that's descriptive - like using the uid for the folder name instead of the nondescript user.workflow.alphanumeric.on.steroids.


    Could be wrong, I would try it out but with my luck I will screw something badly. Let me make a backup of my workflows when I have time and get back to you on that.


    - Thanks a lot for this hazel script! I have been looking for ways to implement hazel and alfred and this can start my collection off. Do you mind if I post here any I work up, if I get them to work? I will post my ideas too in case others who can code want to try but wanna get your permission if that's okay before I steal your thread. Thanks again for sharing!

  • Create New...