text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
if prtdDueDate is not missing value then | ExportThings.applescript |
write tab & ">> Due: " & date string of prtdDueDate & linefeed to theFile | ExportThings.applescript |
if prtdNotes is not "" then | ExportThings.applescript |
repeat with prnoteParagraph in paragraphs of prtdNotes | ExportThings.applescript |
write tab & tab & prnoteParagraph & linefeed to theFile | ExportThings.applescript |
write linefeed & "----------" & linefeed to theFile | ExportThings.applescript |
write "| Tags:" & linefeed & linefeed to theFile | ExportThings.applescript |
repeat with aTag in tags | ExportThings.applescript |
write "- " & name of aTag & linefeed to theFile | ExportThings.applescript |
close access theFile | ExportThings.applescript |
set thePath to (path to me as text) | gistfile1 copy 5.applescript |
set AppleScript's text item delimiters to ":" | gistfile1 copy 5.applescript |
set thePathItems to text items of thePath | gistfile1 copy 5.applescript |
set AppleScript's text item delimiters to {""} | gistfile1 copy 5.applescript |
set parsedPath to items 1 thru ((count of items of thePathItems) - 2) of thePathItems | gistfile1 copy 5.applescript |
set parentPath to parsedPath as string | gistfile1 copy 5.applescript |
set SmartyPants to parentPath & ":Text Filters:SmartyPants.pl" | gistfile1 copy 5.applescript |
set Markdown to parentPath & ":Text Filters:Markdown.pl" | gistfile1 copy 5.applescript |
tell application "BBEdit" | gistfile1 copy 5.applescript |
set theItem to (contents of window 1 as text) | gistfile1 copy 5.applescript |
set theDocument to (make new text document of window 1) | gistfile1 copy 5.applescript |
set theVersion to version | gistfile1 copy 5.applescript |
set encoding of theDocument to "Unicode (UTF-8)" | gistfile1 copy 5.applescript |
set text of theDocument to theItem | gistfile1 copy 5.applescript |
set name of theDocument to "HTML output" | gistfile1 copy 5.applescript |
set source language of theDocument to "HTML" | gistfile1 copy 5.applescript |
replacemeliteral("web site", "website") | gistfile1 copy 5.applescript |
replacemeliteral("e-mail", "email") | gistfile1 copy 5.applescript |
replacemeliteral("e-book", "ebook") | gistfile1 copy 5.applescript |
replacemeliteral("Ethernet", "ethernet") | gistfile1 copy 5.applescript |
replacemeliteral(" target=\"_blank\"", "") | gistfile1 copy 5.applescript |
replacemeliteral("web page", "webpage") | gistfile1 copy 5.applescript |
replacemeliteral("home page", "homepage") | gistfile1 copy 5.applescript |
replacemeliteral("NVIDIA", "Nvidia") | gistfile1 copy 5.applescript |
replaceme("(Command|Control|Option|Shift)\\+(Command|Control|Option|Shift)\\+(.)", "\\1-\\2-\\3") | gistfile1 copy 5.applescript |
replaceme("(Command|Control|Option|Shift)\\+(.)", "\\1-\\2") | gistfile1 copy 5.applescript |
replacemeliteral("£", "[poundsymbol]") | gistfile1 copy 5.applescript |
replacemeliteral("preview.www.", "www.") | gistfile1 copy 5.applescript |
run unix filter Markdown with replacing selection | gistfile1 copy 5.applescript |
run unix filter SmartyPants with replacing selection | gistfile1 copy 5.applescript |
replaceme(" *-- *", "—") | gistfile1 copy 5.applescript |
replacemeliteral(">", "[greaterthansymbol]") | gistfile1 copy 5.applescript |
replacemeliteral("<", "[lessthansymbol]") | gistfile1 copy 5.applescript |
translate html to text entity conversion true ¬ | gistfile1 copy 5.applescript |
create new document false ¬ | gistfile1 copy 5.applescript |
without selection only | gistfile1 copy 5.applescript |
replacemeliteral("[greaterthansymbol]", ">") | gistfile1 copy 5.applescript |
replacemeliteral("[lessthansymbol]", "<") | gistfile1 copy 5.applescript |
replacemeliteral("[euro]", "€") | gistfile1 copy 5.applescript |
replacemeliteral("[poundsymbol]", "£") | gistfile1 copy 5.applescript |
replaceme("\\[\\[([0-5])\\.([05]) (mice)\\]\\]", "<img src=\"http://images.macworld.com/images/layout/bluemouse\\1\\2.gif\" border=\"0\" alt=\"2.5-mouse rating\"/>") | gistfile1 copy 5.applescript |
replaceme("<p>\\[\\[jump\\]\\]</p>", "<a href=\"/jump\">Read more...</a>") | gistfile1 copy 5.applescript |
replacemeliteral(" — ", "—") | gistfile1 copy 5.applescript |
replaceme("‘(?=[0-9]{2}[^0-9])", "’") | gistfile1 copy 5.applescript |
on replaceme(theFind, theReplace) | gistfile1 copy 5.applescript |
replace theFind using theReplace searching in text of text window 1 options {search mode:grep, starting at top:true, wrap around:true, backwards:false, case sensitive:false, match words:false, extend selection:false} | gistfile1 copy 5.applescript |
end replaceme | gistfile1 copy 5.applescript |
on replacemeliteral(theFind, theReplace) | gistfile1 copy 5.applescript |
replace theFind using theReplace searching in text of text window 1 options {search mode:literal, starting at top:true, wrap around:true, backwards:false, case sensitive:false, match words:false, extend selection:false} | gistfile1 copy 5.applescript |
end replacemeliteral | gistfile1 copy 5.applescript |
do shell script "ls" | 36_01_shell_command_in_applescript.applescript |
tell application "Vivaldi" to set appName to name | TTRPT02 copy.applescript |
tell script "Business Objects utilities" to init(appName) | TTRPT02 copy.applescript |
tell script "Run TTRPT02" to run | TTRPT02 copy.applescript |
set file_names to {} | Script 29-5.applescript |
set the_files to every file of folder "Macintosh HD:Users:hanaan:src:" | Script 29-5.applescript |
repeat with file_ref in the_files | Script 29-5.applescript |
set end of file_names to name of file_ref | Script 29-5.applescript |
return file_names | Script 29-5.applescript |
use AppleScript version "2.4" -- Yosemite (10.10) or later | OpenPanel.applescript |
use framework "Cocoa" | OpenPanel.applescript |
property buttonList : [¬ | OpenPanel.applescript |
{title:"Select Folders", frame:[{5, 5}, {120, 20}], selector:"canChooseDirectories", value:true}, ¬ | OpenPanel.applescript |
{title:"Select Files", frame:[{5, 30}, {150, 20}], selector:"canChooseFiles", value:true}, ¬ | OpenPanel.applescript |
{title:"Show Packages", frame:[{150, 5}, {120, 20}], selector:"treatsFilePackagesAsDirectories", value:false}, ¬ | OpenPanel.applescript |
{title:"Show Hidden", frame:[{150, 30}, {120, 20}], selector:"showsHiddenFiles", value:false}] | OpenPanel.applescript |
property defaultDirectory : POSIX path of (path to desktop) -- a place to start | OpenPanel.applescript |
property setup : missing value | OpenPanel.applescript |
global response, newer | OpenPanel.applescript |
on run -- run from the Script Editor or app double-clicked | OpenPanel.applescript |
initialize() | OpenPanel.applescript |
my performPanel:me | OpenPanel.applescript |
on open someItems -- items dropped onto the app | OpenPanel.applescript |
processItems(someItems) | OpenPanel.applescript |
end open | OpenPanel.applescript |
on initialize() -- set stuff up when first run | OpenPanel.applescript |
if setup is not missing value then return | OpenPanel.applescript |
set newer to (system attribute "sys2") ≥ 12 -- system version | OpenPanel.applescript |
set mainMenu to current application's NSApplication's sharedApplication's mainMenu | OpenPanel.applescript |
set fileMenu to (mainMenu's itemAtIndex:1)'s submenu | OpenPanel.applescript |
set openItem to fileMenu's indexOfItemWithTitle:"Open…" | OpenPanel.applescript |
if openItem as integer is -1 then -- no "Open…" menuItem, so add one to the app | OpenPanel.applescript |
set menuItem to current application's NSMenuItem's alloc's ¬ | OpenPanel.applescript |
initWithTitle:"Open…" action:"performPanel:" keyEquivalent:"o" | OpenPanel.applescript |
menuItem's setTarget:me | OpenPanel.applescript |
fileMenu's addItem:menuItem | OpenPanel.applescript |
end initialize | OpenPanel.applescript |
to processItems(value) -- handle items to open (example just shows dropped/selected file paths) | OpenPanel.applescript |
if value is missing value then return | OpenPanel.applescript |
set tempTID to AppleScript's text item delimiters | OpenPanel.applescript |
Subsets and Splits