Q: Please help me to improve automator's action
Hello to everyone.
I made an automator action to create a new note
on run {input, parameters}
set the noteName to text returned of (display dialog "Make a Note" with icon 1 default answer "")
tell application "Notes"
set thisAccountName to "iCloud"
make new note at folder "Notes" of account thisAccountName with properties {name:noteName}
end tell
return input
end run
It works like this
Now I’d like to improve it in that way:
- make a wider window for input text to be able to see all the text, not only a few words in one line
- use a default account for a new note
- use a clipboard as a default text
OS X El Capitan (10.11.6)
Posted on Aug 17, 2016 3:18 AM
make a wider window for input text to be able to see all the text, not only a few words in one line
You have virtually no control over the 'display dialog' layout. Your options are to:
1) use the Automator action 'Ask for Text' which performs a similar function, but with a larger text area.
2) switch to a system other than Automator (e.g. AppleScriptObjC) which gives you full UI controls, so you can design your own dialog
3) hack the display dialog input to force a multi-line input field:
set the noteName to text returned of (display dialog "Make a Note" with icon 1 default answer "
")
By providing default answer that is multiple (blank) lines, the dialog expands to show this. It's not perfect, but the work-effort is virtually 0.
- use a default account for a new note
I don't understand what you mean here by 'default account'.
- use a clipboard as a default text
Just:
set the noteName to text returned of (display dialog "Make a Note" with icon 1 default answer (get the clipboard as text))
Posted on Aug 17, 2016 7:22 AM