text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
if item 1 of selectedApplication is equal to "GoogleChrome" then | MarsEdit-MakeLink.scpt |
if (count of window) is equal to 0 then | MarsEdit-MakeLink.scpt |
set siteTitle to title of tabDocument | MarsEdit-MakeLink.scpt |
tell tabDocument | MarsEdit-MakeLink.scpt |
set selectionText to execute javascript "unescape(escape(getSelection()));" as string | MarsEdit-MakeLink.scpt |
log selectionText | MarsEdit-MakeLink.scpt |
if item 1 of selectedApplication is equal to "MarsEdit" then | MarsEdit-MakeLink.scpt |
tell application "MarsEdit" | MarsEdit-MakeLink.scpt |
set blogPosts to posts of selected blog | MarsEdit-MakeLink.scpt |
repeat with i from 1 to count of blogPosts | MarsEdit-MakeLink.scpt |
set blogPost to item i of blogPosts | MarsEdit-MakeLink.scpt |
if published status of blogPost is equal to "Published" then | MarsEdit-MakeLink.scpt |
set siteTitle to title of blogPost | MarsEdit-MakeLink.scpt |
set siteURL to permalink of blogPost | MarsEdit-MakeLink.scpt |
set tmpDate to published date of blogPost | MarsEdit-MakeLink.scpt |
set pubYear to year of tmpDate | MarsEdit-MakeLink.scpt |
set pubMonth to (month of tmpDate) as integer | MarsEdit-MakeLink.scpt |
set pubDay to day of tmpDate | MarsEdit-MakeLink.scpt |
set pubHour to (time of tmpDate) div hours | MarsEdit-MakeLink.scpt |
set pubMinute to (time of tmpDate) mod minutes | MarsEdit-MakeLink.scpt |
set pubSecond to ((time of tmpDate) mod hours) div minutes | MarsEdit-MakeLink.scpt |
set sitePubDate to (pubYear & "/" & pubMonth & "/" & pubDay & " " & pubHour & ":" & pubMinute & ":" & pubSecond) as string | MarsEdit-MakeLink.scpt |
set siteRecords to {{wwwTitle:siteTitle, wwwURL:siteURL, wwwPubDate:sitePubDate, listTitle:(((count of blogPosts) - i + 1) & ": " & siteTitle) as string}} & siteRecords | MarsEdit-MakeLink.scpt |
if (count of siteRecords) is greater than 0 then | MarsEdit-MakeLink.scpt |
set selectedItems to chooseItems(siteRecords) of me | MarsEdit-MakeLink.scpt |
if selectedItems is equal to 0 then | MarsEdit-MakeLink.scpt |
insertMarsEdit(selectedItems) of me | MarsEdit-MakeLink.scpt |
on chooseItems(targetList) | MarsEdit-MakeLink.scpt |
set dialogMessage to "リストを作る項目を選択してください (Cmd + クリック で複数選択)" | MarsEdit-MakeLink.scpt |
set listTitles to {} | MarsEdit-MakeLink.scpt |
repeat with i from 1 to count of targetList | MarsEdit-MakeLink.scpt |
set the end of listTitles to listTitle of (item i of targetList) | MarsEdit-MakeLink.scpt |
set selectedListTitles to choose from list listTitles with prompt dialogMessage default items (item 1 of listTitles) with multiple selections allowed | MarsEdit-MakeLink.scpt |
if selectedListTitles = false then return 0 | MarsEdit-MakeLink.scpt |
set selectedRecords to {} | MarsEdit-MakeLink.scpt |
repeat with j from 1 to count of selectedListTitles | MarsEdit-MakeLink.scpt |
if item i of targetList contains {listTitle:item j of selectedListTitles} then | MarsEdit-MakeLink.scpt |
set the end of selectedRecords to item i of targetList | MarsEdit-MakeLink.scpt |
if (count of selectedRecords) is equal to 0 then | MarsEdit-MakeLink.scpt |
return selectedRecords | MarsEdit-MakeLink.scpt |
end chooseItems | MarsEdit-MakeLink.scpt |
on insertMarsEdit(targetItems) | MarsEdit-MakeLink.scpt |
if (count of targetItems) is equal to 0 then | MarsEdit-MakeLink.scpt |
set insertText to formattedText(targetItems) of DataObject | MarsEdit-MakeLink.scpt |
set selected text in document 1 to insertText as text | MarsEdit-MakeLink.scpt |
end insertMarsEdit | MarsEdit-MakeLink.scpt |
on replaceStringAction(targetText, beforeString, afterString) | MarsEdit-MakeLink.scpt |
copy targetText to tmpText | MarsEdit-MakeLink.scpt |
set origDelimiter to AppleScript's text item delimiters | MarsEdit-MakeLink.scpt |
set AppleScript's text item delimiters to beforeString | MarsEdit-MakeLink.scpt |
set tmpList to every text item of tmpText | MarsEdit-MakeLink.scpt |
set AppleScript's text item delimiters to afterString | MarsEdit-MakeLink.scpt |
set tmpText to tmpList as string | MarsEdit-MakeLink.scpt |
set AppleScript's text item delimiters to origDelimiter | MarsEdit-MakeLink.scpt |
return tmpText | MarsEdit-MakeLink.scpt |
end replaceStringAction | MarsEdit-MakeLink.scpt |
on replaceHtmlEntity(targetText) | MarsEdit-MakeLink.scpt |
set tmpText to replaceStringAction(tmpText, "&", "&") | MarsEdit-MakeLink.scpt |
set tmpText to replaceStringAction(tmpText, "<", "<") | MarsEdit-MakeLink.scpt |
set tmpText to replaceStringAction(tmpText, ">", ">") | MarsEdit-MakeLink.scpt |
set tmpText to replaceStringAction(tmpText, "\"", """) | MarsEdit-MakeLink.scpt |
end replaceHtmlEntity | MarsEdit-MakeLink.scpt |
on processBundleID(bundleID) | MarsEdit-MakeLink.scpt |
set aProcess to every process whose bundle identifier is equal to bundleID | MarsEdit-MakeLink.scpt |
if aProcess = {} then | MarsEdit-MakeLink.scpt |
set aProcess to contents of first item of aProcess | MarsEdit-MakeLink.scpt |
return aProcess | MarsEdit-MakeLink.scpt |
end processBundleID | MarsEdit-MakeLink.scpt |
property NSStatusBar : class "NSStatusBar" | AppDelegate copy 15.applescript |
property theStatusMenu : missing value | AppDelegate copy 15.applescript |
on clickMe:sender | AppDelegate copy 15.applescript |
display alert "hello (again)" | AppDelegate copy 15.applescript |
on greet:sender | AppDelegate copy 15.applescript |
on |preferences|:sender | AppDelegate copy 15.applescript |
tell theWindow to makeKeyAndOrderFront_(me) | AppDelegate copy 15.applescript |
property theStatusItem : missing value | AppDelegate copy 15.applescript |
on menuWillOpen:notification | AppDelegate copy 15.applescript |
on menuDidClose:notification | AppDelegate copy 15.applescript |
set l to current application's NSVariableStatusItemLength | AppDelegate copy 15.applescript |
set theStatusItem to NSStatusBar's systemStatusBar's statusItemWithLength_(l) | AppDelegate copy 15.applescript |
tell theStatusItem to setTitle_("🐱") | AppDelegate copy 15.applescript |
tell theStatusItem to setMenu_(theStatusMenu) | AppDelegate copy 15.applescript |
tell theStatusMenu to setDelegate_(me) | AppDelegate copy 15.applescript |
tell theWindow to |center|() | AppDelegate copy 15.applescript |
set finderSelectionList to selection as alias list | Finder2Terminal-selectedFolder.applescript |
if length of finderSelectionList = 0 then error "No files were selected in the Finder!" | Finder2Terminal-selectedFolder.applescript |
set theItem to item 1 of finderSelectionList | Finder2Terminal-selectedFolder.applescript |
if kind of (item theItem) is in {"Application", "Folder"} then | Finder2Terminal-selectedFolder.applescript |
set itemPath to POSIX path of (theItem as text) | Finder2Terminal-selectedFolder.applescript |
error "Error:" & linefeed & linefeed & "Improper item selected in the Finder!" | Finder2Terminal-selectedFolder.applescript |
set shCMD to "cd " & quoted form of itemPath | Finder2Terminal-selectedFolder.applescript |
tell selected tab of front window | Finder2Terminal-selectedFolder.applescript |
if its busy = false then | Finder2Terminal-selectedFolder.applescript |
do script shCMD in it | Finder2Terminal-selectedFolder.applescript |
do script shCMD | Finder2Terminal-selectedFolder.applescript |
on error e number n | Finder2Terminal-selectedFolder.applescript |
set e to e & return & return & "Num: " & n | Finder2Terminal-selectedFolder.applescript |
if n ≠ -128 then | Finder2Terminal-selectedFolder.applescript |
tell application (path to frontmost application as text) to set ddButton to button returned of ¬ | Finder2Terminal-selectedFolder.applescript |
(display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬ | Finder2Terminal-selectedFolder.applescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.