VCOF0118
OmniFocus: Reset Note Character/Paragraph Settings
A voice command for setting the character or paragraph attributes of the note of the selected project or task, to their default values.
Scope and Syntax
Language: English (United States 🇺🇸 · Great Britain 🇬🇧 · Australia 🇦🇺 · Canada 🇨🇦) • Scope: OmniFocus
Command phrase variations (words in [brackets] are optional):
- “Reset Character Settings”
- “Restore Character Defaults”
- “Reset Paragraph Settings”
- “Restore Paragraph Defaults”
- “Reset Note Settings”
- “Restore Note Defaults”
Requirements
- Application: OmniFocus 4
- System: macOS 12, iPadOS 15, iOS 15
Video: Note Settings |
A set of voice commands for controlling the formatting of the note text of the selected project or task. |
|
Downloads
- ⇩ COMMANDS-FILE OmniFocus 4.0 (macOS)
- ⇩ SHORTCUT-LINK (“Reset Character Settings”)
- ⇩ SHORTCUT-LINK (“Reset Paragraph Settings”)
- ⇩ SHORTCUT-LINK (“Reset Note Settings”)
Using the Commands
Reset Character Settings
(async () => {
try {
function createUtterance(textToSpeak){
AlexID = (
(app.platformName === "macOS") ?
"com.apple.speech.synthesis.voice.Alex" :
"com.apple.speech.voice.Alex"
)
voiceObj = Speech.Voice.withIdentifier(AlexID)
voiceRate = 0.4
utterance = new Speech.Utterance(textToSpeak)
utterance.voice = voiceObj
utterance.rate = voiceRate
return utterance
}
var synthesizer = new Speech.Synthesizer()
var sel = document.windows[0].selection
if(sel.tasks.length === 1 || sel.projects.length === 1 ){
var item = sel.databaseObjects[0]
} else {
throw {
name: "Selection Issue",
message: "Please select a single project or task."
}
}
if(item.note.length === 0){
throw {
name: "Selection Issue",
message: "The note of the selected item, contains no text."
}
}
var item = sel.databaseObjects[0]
// reveal note
tree = document.windows[0].content
tree.nodeForObject(item).expandNote(false)
// formatting
var fAtts = [
Style.Attribute.FontCondensed,
Style.Attribute.FontFamily,
Style.Attribute.FontFillColor,
Style.Attribute.FontFixedPitch,
Style.Attribute.FontItalic,
Style.Attribute.FontName,
Style.Attribute.FontNarrow,
Style.Attribute.FontSize,
Style.Attribute.FontStrokeColor,
Style.Attribute.FontStrokeWidth,
Style.Attribute.FontWeight,
Style.Attribute.KerningAdjustment,
Style.Attribute.Obliqueness,
Style.Attribute.BaselineOffset,
Style.Attribute.BaselineSuperscript,
Style.Attribute.Expansion
]
// CREATE VIRTUAL TEXT OBJECT CONTAING CURRENT NOTE
var noteObj = new Text("", baseStyle)
noteObj.replace(noteObj.range, item.noteText)
// GET ATTRIBUTE RUNS
runRanges = noteObj.ranges(TextComponent.AttributeRuns)
// PROCESS ATTRIBUTE RUNS
runRanges.forEach(range => {
runStyle = noteObj.styleForRange(range)
fAtts.forEach(att => {
runStyle.set(att, att.defaultValue)
})
})
// REPLACE NOTE WITH VIRTUAL OBJECT
item.noteText.replace(item.noteText.range, noteObj)
utterance = createUtterance("Default values applied.")
synthesizer.speakUtterance(utterance)
}
catch(err){
utterance = createUtterance(err.message)
synthesizer.speakUtterance(utterance)
//new Alert(err.name, err.message).show()
}
})();
Reset Paragraph Settings
(async () => {
try {
function createUtterance(textToSpeak){
AlexID = (
(app.platformName === "macOS") ?
"com.apple.speech.synthesis.voice.Alex" :
"com.apple.speech.voice.Alex"
)
voiceObj = Speech.Voice.withIdentifier(AlexID)
voiceRate = 0.4
utterance = new Speech.Utterance(textToSpeak)
utterance.voice = voiceObj
utterance.rate = voiceRate
return utterance
}
var synthesizer = new Speech.Synthesizer()
var sel = document.windows[0].selection
if(sel.tasks.length === 1 || sel.projects.length === 1 ){
var item = sel.databaseObjects[0]
} else {
throw {
name: "Selection Issue",
message: "Please select a single project or task."
}
}
if(item.note.length === 0){
throw {
name: "Selection Issue",
message: "The note of the selected item, contains no text."
}
}
// REVEAL NOTE
tree = document.windows[0].content
tree.nodeForObject(item).expandNote(false)
// PARAGRAPH ATTRIBUTES
var pAtts = [
Style.Attribute.ParagraphBaseWritingDirection,
Style.Attribute.ParagraphAlignment,
Style.Attribute.ParagraphFirstLineHeadIndent,
Style.Attribute.ParagraphHeadIndent,
Style.Attribute.ParagraphLineHeightMultiple,
Style.Attribute.ParagraphLineSpacing,
Style.Attribute.ParagraphMaximumLineHeight,
Style.Attribute.ParagraphMinimumLineHeight,
Style.Attribute.ParagraphSpacing,
Style.Attribute.ParagraphSpacingBefore,
Style.Attribute.ParagraphDefaultTabInterval,
Style.Attribute.ParagraphTabStops,
Style.Attribute.ParagraphTailIndent
]
// CREATE VIRTUAL TEXT OBJECT CONTAING CURRENT NOTE
var noteObj = new Text("", baseStyle)
noteObj.replace(noteObj.range, item.noteText)
// GET ATTRIBUTE RUNS
runRanges = noteObj.ranges(TextComponent.AttributeRuns)
// PROCESS ATTRIBUTE RUNS
runRanges.forEach(range => {
runStyle = noteObj.styleForRange(range)
pAtts.forEach(att => {
runStyle.set(att, att.defaultValue)
})
})
// REPLACE NOTE WITH VIRTUAL OBJECT
item.noteText.replace(item.noteText.range, noteObj)
utterance = createUtterance("Default values applied.")
synthesizer.speakUtterance(utterance)
}
catch(err){
utterance = createUtterance(err.message)
synthesizer.speakUtterance(utterance)
//new Alert(err.name, err.message).show()
}
})();
Reset Note Settings
(async () => {
try {
function createUtterance(textToSpeak){
AlexID = (
(app.platformName === "macOS") ?
"com.apple.speech.synthesis.voice.Alex" :
"com.apple.speech.voice.Alex"
)
voiceObj = Speech.Voice.withIdentifier(AlexID)
voiceRate = 0.4
utterance = new Speech.Utterance(textToSpeak)
utterance.voice = voiceObj
utterance.rate = voiceRate
return utterance
}
var synthesizer = new Speech.Synthesizer()
var sel = document.windows[0].selection
if(sel.tasks.length === 1 || sel.projects.length === 1 ){
var item = sel.databaseObjects[0]
} else {
throw {
name: "Selection Issue",
message: "Please select a single project or task."
}
}
if(item.note.length === 0){
throw {
name: "Selection Issue",
message: "The note of the selected item, contains no text."
}
}
// REVEAL NOTE
tree = document.windows[0].content
tree.nodeForObject(item).expandNote(false)
// TEXT ATTRIBUTES
var pAtts = [
Style.Attribute.ParagraphBaseWritingDirection,
Style.Attribute.ParagraphAlignment,
Style.Attribute.ParagraphFirstLineHeadIndent,
Style.Attribute.ParagraphHeadIndent,
Style.Attribute.ParagraphLineHeightMultiple,
Style.Attribute.ParagraphLineSpacing,
Style.Attribute.ParagraphMaximumLineHeight,
Style.Attribute.ParagraphMinimumLineHeight,
Style.Attribute.ParagraphSpacing,
Style.Attribute.ParagraphSpacingBefore,
Style.Attribute.ParagraphDefaultTabInterval,
Style.Attribute.ParagraphTabStops,
Style.Attribute.ParagraphTailIndent,
Style.Attribute.FontCondensed,
Style.Attribute.FontFamily,
Style.Attribute.FontFillColor,
Style.Attribute.FontFixedPitch,
Style.Attribute.FontItalic,
Style.Attribute.FontName,
Style.Attribute.FontNarrow,
Style.Attribute.FontSize,
Style.Attribute.FontStrokeColor,
Style.Attribute.FontStrokeWidth,
Style.Attribute.FontWeight,
Style.Attribute.KerningAdjustment,
Style.Attribute.Obliqueness,
Style.Attribute.BaselineOffset,
Style.Attribute.BaselineSuperscript,
Style.Attribute.Expansion
]
// CREATE VIRTUAL TEXT OBJECT CONTAING CURRENT NOTE
var noteObj = new Text("", baseStyle)
noteObj.replace(noteObj.range, item.noteText)
// GET ATTRIBUTE RUNS
runRanges = noteObj.ranges(TextComponent.AttributeRuns)
// PROCESS ATTRIBUTE RUNS
runRanges.forEach(range => {
runStyle = noteObj.styleForRange(range)
pAtts.forEach(att => {
runStyle.set(att, att.defaultValue)
})
})
// REPLACE NOTE WITH VIRTUAL OBJECT
item.noteText.replace(item.noteText.range, noteObj)
utterance = createUtterance("Default values applied.")
synthesizer.speakUtterance(utterance)
}
catch(err){
utterance = createUtterance(err.message)
synthesizer.speakUtterance(utterance)
//new Alert(err.name, err.message).show()
}
})();
LEGAL
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Mention of third-party websites and products is for informational purposes only and constitutes neither an endorsement nor a recommendation. OMNI-AUTOMATION.COM assumes no responsibility with regard to the selection, performance or use of information or products found at third-party websites. OMNI-AUTOMATION.COM provides this only as a convenience to our users. OMNI-AUTOMATION.COM has not tested the information found on these sites and makes no representations regarding its accuracy or reliability. There are risks inherent in the use of any information or products found on the Internet, and OMNI-AUTOMATION.COM assumes no responsibility in this regard. Please understand that a third-party site is independent from OMNI-AUTOMATION.COM and that OMNI-AUTOMATION.COM has no control over the content on that website. Please contact the vendor for additional information.