Jump to content

bencfd

Member
  • Posts

    63
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by bencfd

  1. Hi,

     

    I'm posting this in Discussion as it is not technically a bug report (or is it?). I used to start Alfred using AppleScript with

    tell application "Alfred 2" to launch
    

    but this doesn't work anymore. I suspect it's because there is no Standard Suite (with commands such as open, launch, close) in the AppleScript Dictionary for Alfred. Is it possible to bring this suite back in the dictionary? Thanks a lot!

  2. Whenever I launch the iTunes mini player I am unable to access Podcasts. I have lots of subscriptions and I can see them listed in the iTunes Music Library.xml file. I have 'Include Podcasts' enabled in Alfred but cannot view them.

     

    When I launch the mini player I see: Genres; Artists; Albums; Playlists; Random Album. If I search through these there is nothing that I can find related to Podcasts.

     

    Am I missing something?

     

    I don't see anything related to Podcasts neither in the initial iTunes MiniPlayer window, but at least I'm able to search for podcast episodes and podcast "albums".

  3.  

    /usr/local/bin is not a language (neither is /bin or /usr/bin). They're directories.

     

    Your environment has a variable called PATH, which is a list of directories. When a program (or a shell) wants to run another program, it can simply call it by name (e.g. VBoxManage) provided it is in one of the directories in PATH.

     

    Alfred's PATH is the default one of /bin and /usr/bin, so any program in either of those directories can be called by name.

     

    If you want to run a program in /usr/local/bin, you have to call it by its full path, e.g. /usr/local/bin/VBoxManage.

     

    So, instead of running VBoxManage startvm "vm_name" you just need to run:

    /usr/local/bin/VBoxManage startvm "vm_name"
    

     

    Thank you very much @deanishe for the explanations and the solution you provided, that makes sense and works perfectly!

  4. Hi everyone!

     

    For long, I've been launching VirtualBox's virtual machines with the following script, bin/bash being the language selected:

    VBoxManage startvm "vm_name"
    

    In a recent update, it seems that VirtualBox moved the necessary "files" (I don't really know/understand what happens in the background) from /usr/bin to /usr/local/bin. See this topic: https://forums.virtualbox.org/viewtopic.php?f=8&t=68825. People there pointed that it might be related to recent security restrictions in OS X (Yosemite, El Capitan).

     

    From the Terminal, when I first point to /usr/local/bin, the previous piece of code works perfectly. So my question is, how can I point to that special directory from a Run script window of a workflow?

     

    Ultimately, should Alfred be updated to offer /usr/local/bin in the Language list?

     

    Thanks for your help!

  5. Hi there!

     

    qWorkflow looks like what I was looking for since long, thank you for this! Based on your iTunes Ratings workflow, I'm trying to have Alfred show a list of my calendars, as in the Calendar app.

    tell application "Calendar"
    	set calendarsList to name of calendars
    end tell
    

    Typing a few letters, I would like Alfred to display the matching calendar names, so as to perform some magical calculations with the one of my choice at next step, using AppleScript again.

    I assumed the Script Filter should be something like this:

    # get the workflow's source folder
    set workflowFolder to do shell script "pwd"
    
    # load the Workflow library
    set wlib to load script POSIX file (workflowFolder & "/q_workflow.scpt")
    
    # create a new Workflow Class
    set wf to wlib's new_workflow()
    
    try
    	tell application "Calendar"
    		set calendarList to name of calendars
    	end tell
    	repeat with i from 1 to (count of calendarList)
    		add_result of wf with isValid given theUid:"", theArg:i, theTitle:(item i of calendarList), theAutocomplete:"", theSubtitle:(item i of calendarList)
    	end repeat
    	
    	# show all the results in Alfred
    	wf's to_xml("")
    on error
    	# if an error, it's probably because there's no
    	# song currently playing in iTunes, so show
    	# the appropriate feedback error result
    	add_result of wf without isValid given theUid:"", theArg:missing value, theTitle:"There is no song playing :(", theAutocomplete:"", theSubtitle:"Couldn't get the currently playing song", theIcon:"icon.png", theType:""
    	wf's to_xml("")
    end try
    

    I kept the same error message from the iTunes Ratings workflow, at least it confirms me that it's not working :D  I guess I simply don't understand how qWorkflow works  :wacko: So, I'm sorry for this very low level question, but... How could I generate such a feedback in Alfred?

     

    Thank you very much in advance for your help!

  6. Thank you fniephaus for this nice workflow, it's very practical to turn off the screen for a movie time! :D  Would you have an idea how to apply to the keyboard's backlight as well? I've been searching a bit, but I don't really understand what I found.

  7. This workflow was written for Ruby 1.9.3 which was the default in Mountain Lion. In Mavericks, Ruby 2.0 is now the default. The workflow needs to be updated to support Ruby 2.0. I don't really have the time to do this myself, but I'd be happy to accept a pull request on Github.

     

    So that was just because of this... Then, I'll consider the pull request and be patient :)

  8.  

    For the people that are having trouble pairing, I have two questions:

     

    1. Is iTunes running when you try to pair? (it should be)
    2. Do you have sharing enabled in iTunes?

     

     

     

    Almost one year has passed but let's try again!
     

     

    Yes, iTunes is running and sharing is enabled.
     

    Try this,

    1. Open Alfred's preferences and go to the Workflows pane
    2. Right click on the Up Next workflow and then click "Show in Finder"
    3. Open Terminal in /Applications/Utilities
    4. In Terminal, type "cd " (note the space at the end) and then drag the little blue folder icon from the top on the finder window into the terminal window and hit enter
    5. Now in Terminal, type "ruby pair.rb " followed by a 4-digit number pin and hit enter
    6. Paste the results here

     

     

    I'll look into this right away!

     

     

    So, results are a bit different today. Here's what the Terminal says:

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- alfred (LoadError)
    	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
    	from pair.rb:6:in `<main>'
    

    Is something missing from my side?

  9. Hi,

    I am a total newbie. Does anybody know how to create a workflow to open Safari in Full Screen mode when Google searching?

    I'd appreciate your solution. Thanks!

     

    Hi,

     

    I've added to the Google Searches workflow from Vero a "Run Scrip" item, including this:

    set SafariFullscreenStatus to ""
    tell application "System Events"
    	try
    		set SafariFullscreenStatus to (value of attribute "AXFullScreen" of first window of application process "Safari")
    	end try
    end tell
    if SafariFullscreenStatus is false then
    	tell application "Safari" to activate
    	tell application "System Events" to keystroke "f" using {command down, control down}
    end if
    

    It's UI scripting though, but it works like a charm.

  10. This will probably be useful for very few people (e.g., archaeologists, palaeologists), but as I made this workflow, I share it!

     

    It converts BP times (Before Present) to BC/AD years, and reversely. The BC times have to be given as negative years.

    The result is copied to the clipboard, and alternatively as "cal. BP" or "cal. BC" when holding the action modifier Alt.

     

    Download

     

  11. Hi everyone,

     

    I thought few days ago about a workflow I'd like to use. I tried to develop it, but it is far above my skills, that's why I'm asking you. Simply put, I love Mission Control, but I love Alfred more!

     

    The idea (pretty simple): the keyword switch for example would list all running app. On return, Alfred would then list the different desktops (including the identifier of the screen in the subtitle field). After selecting one desktop, Alfred moves the window of the app previously selected to the destination desktop.

    Additionally, the keyword desktop would directly list the desktops, to switch from one to another.

     

    Listing the running apps is something I could do, there are many workflows I can take as example to achieve this, but I can't script the desktop thing. Does someone has an idea how to do this? thank you very much!

  12. Hi,

     

    Having the downloads from Safari in the Downloads folder is perfectly fine for me for most cases, but sometimes (for automation reasons) I would like to be able to choose where to save a PDF (which is displayed by Safari). And I think a workflow would be great for that!

     

    I can probably figure out the last steps of such a workflow to choose the relevant folder with a Script Filter and save the PDF using AppleScript, but does anyone know how I can "extract/access" the PDF in the first place?

     

    Thanks a lot!

  13. Hi,

     

    I'm having trouble creating a workflow. Based on help found on macscripter.net, I wrote an AppleScript to change decimal and thousands separator within csv files.

    tell application "Finder" to set FileToEdit to selection as string
    set AccessToFile to open for access file FileToEdit with write permission
    set CSVContent to read file FileToEdit
    
    to switchText from t to r instead of s
    	set d to text item delimiters
    	set text item delimiters to s
    	set t to t's text items
    	set text item delimiters to r
    	tell t to set t to item 1 & ({""} & rest)
    	set text item delimiters to d
    	t
    end switchText
    
    switchText from CSVContent to "." instead of ","
    set FirstStepText to result
    switchText from FirstStepText to "," instead of ";"
    set TextToWrite to result
    
    set eof of file FileToEdit to 0
    write TextToWrite to AccessToFile
    close access AccessToFile
    

    The script works fine from the Finder selection. However, I would like to turn into an Alfred workflow, using a file filter.

    To do so, the file filter searches for csv files, and I changed the first line of the script to:

    set FileToEdit to POSIX file q
    

    ... or other variants, but nothing worked.

     

    Do you have any idea to fix it? Thanks!

     

  14. Hi,

     

    Sorry for answering so late. Thank you all very much for your help.

    So I modified the Running workflow, adding an AppleScript to minimize window(s) of an app.

     

    The script itself (for instance with Safari) works perfectly:

    tell application "Safari"
    	set miniaturized of every window to true
    end tell
    

    ... but does not work once in the workflow:

    on alfred_script(q)
    	tell application q
    		activate
    		set miniaturized of every window to true
    	end tell
    end alfred_script
    

    Any idea why? Is it because of the process/application difference?

  15. 4. In Terminal, type "cd " (note the space at the end) and then drag the little blue folder icon from the top on the finder window into the terminal window and hit enter

     

    I assume you referred to the main folder of the workflow. Unfortunately, I got no result to paste (only the basic command invite).

×
×
  • Create New...