Jump to content

phcyso

Member
  • Posts

    4
  • Joined

  • Last visited

Posts posted by phcyso

  1. I'd use bash.  The built-in open command has a flag -g which opens an app without bringing it to the foreground.

     

    If you want to wrap it in Applescript, it'd look like this:

     

    do shell script "open -g /Applications/XXX.app"

    The app already opens in the background by itself , I am trying to force it to show its window though its keyboard shortcut.

     

     

    @phcyso: Your script works perfectly for me. How are you triggering the script?

    I have been trying to use the workflow action 'run script' and run 'nsAppleScript'

    They work in that the window flashes up but as the app has no dock icon and is just a floating window the focus reverts to the previous window.

     

    The script works perfectly if i trigger it from the terminal manually. It does not work if i use the 'terminal command' action to run the script.

  2. Hi

     

    I use fluidApp( http://fluidapp.com/ ) for a whole bunch of websites and like to pin then to the task menu so they are still running but are out of sight.

     

    I have been trying to find a way to get Alfred to force them to activate but have been running into trouble with Alfred setting the focus back to the previously running app.

     

    The closest i have gotten is a workflow that Opens the app and then had a output script to send a hotkey to the system that brings the window to the front. 

     

    This causes the app to pop up for a second or two before focus returns to the previous window causing the fluidapp to close.

     

    Is there a flag i can set on a workflow to disable to focus setting behaviour?

     

    Thank you

     

     

     

    the sample applescript i'm using: 

     

    on is_running(appName)
    	tell application "System Events" to (name of processes) contains appName
    end is_running
    
    on activate_app()
    	tell application "System Events"
    		keystroke "m" using {command down, shift down, option down, control down}
    	end tell
    end activate_app
    
    if is_running("APPNAME") then
    	activate_app()
    	return "Running"
    else
    	tell application "APP" to activate
    	delay (1)
    	activate_app()
    end if
    
×
×
  • Create New...