Jump to content

[SOLVED] Trying to make TextEdit workflow to open new window


Recommended Posts

Hello. I'm a newb to AppleScript and am trying to make a workflow to open a new TextEdit window, similar to this one made for Chrome: https://github.com/caiogondim/alfred-chrome-window-workflow .

 

Here is my current script:

on alfred_script(q)

tell application "TextEdit"
    make new window
	tell application "System Events" to set frontmost of process "TextEdit" to true
	activate
end tell

end alfred_script

Here's the workflow:image.png.8ec1cc6f26ffdcaa04af4fc281446da7.png

 

Calling it in Alfred with "tw" results in no behavior. Could someone please help me out?

 

Edited by vitor
Solved by deanishe
Link to post

Your script is wrong/not compatible with Run Script.

 

on alfred_script(q) is only for Run NSAppleScript (which you shouldn’t use).

 

For a regular Run Script action, just use:

tell application "TextEdit"
    make new document
    activate
end tell

 

 

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...