Jump to content

Alfred ignoring "ignoring application responses" block in applescript

Recommended Posts

I've used "ignoring application responses" in an applescript to continue the script without waiting for an answer to the dialog box. It runs perfectly in Applescript Editor but when I use it in Alfred, it ignores them and waits for the dialog. For reference, here is my applescript:


on alfred_script(q)

    set PopClipInput to (display dialog "Type some text for PopClip to use:" with title "PopClip Input" default answer q)

    set PopClipText to the text returned of PopClipInput

    ignoring application responses

        (display dialog "Press option-P to activate PopClip again." default answer PopClipText buttons {"I'm Done"} default button 1)

    end ignoring

    do shell script "/usr/local/bin/cliclick m:460,248"

    delay 0.1

    tell application "PopClip" to appear

end alfred_script


Why is Alfred doing this and what can I do to make my Applescript work?

Link to comment

How are you running it in Alfred? As a Run NSAppleScript Action or via osascript in a Run Script Action?


It's worth trying it the other way (AppleScript is strangely funny about the way it is run).

Edited by deanishe
Link to comment

Well, I have tried it both as a Run NSAppleScript action and a Run Script "osascript" action and neither have worked.


Someone's reply in a similar thread mentioned compiling the applescript as an application/ automator workflow and then creating another script telling the app or workflow to activate, which sounds a little clumsy to me - I would prefer to know why Alfred isn't running the applescript correctly. But I'll try this solution anyway. And I suppose if I put the automator workflow into my Alfred workflow folder it won't be overly clumsy. I'll post an update to let you know if it works.

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...