Jump to content

Simple dialog on application launch


Recommended Posts

This should be really trivial, and in my experience would be in any other "macro" or scripting app, but like most things I've tried to do in Alfred, I can't figure it out.  I've decided to post here in the hopes that someone can share with me the simple solution for this.

 

I just want a dialog to display on launching a particular app, that I have to click OK on to continue, or cancel to abandon the app launch.  Nothing more complex than that.

 

However the only way to do this appears to be via AppleScript, and I can't figure out a way to link the script to an application launch (or anything else actually) after the dialog is accepted.  Script objects don't even appear to allow for anything to execute after them (no outgoing node).  My guess is that I'm missing something fundamental about how Alfred is intended to work.  I've had it since 1.x but ever since the 2.x release I've not been able to get my head 'round anything more complex than a simple keyboard shortcut.  Very disheartening.

 

Anyway, I'm hopeful there is a simple way to accomplish what I seek.  Thanks in advance!

Edited by vanclute
Link to comment
  • 2 weeks later...

Aha... perfect.  I was attempting to chain the applescript node to the application launch node, but I guess that's not the way Alfred wants things to be done.  Thanks for the script!

 

 

this is all you need for your applescript (adjusting text and app name accordingly):

 

if button returned of (display dialog "hello world") is "OK" then tell application "Preview" to activate

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...