text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
on setDesktopPicture(filePath)
|
setDesktopPicture.applescript
|
set filePath to filePath as text
|
setDesktopPicture.applescript
|
if filePath starts with "'" and filePath ends with "'" then
|
setDesktopPicture.applescript
|
set filePath to text 2 thru -2 of filePath
|
setDesktopPicture.applescript
|
if filePath starts with "~" then
|
setDesktopPicture.applescript
|
if filePath is "~" then
|
setDesktopPicture.applescript
|
set filePath to userPath
|
setDesktopPicture.applescript
|
set filePath to userPath & text 2 thru -1 of filePath
|
setDesktopPicture.applescript
|
if filePath does not contain ":" then set filePath to (POSIX file filePath) as text
|
setDesktopPicture.applescript
|
if (exists file filePath) is false then error "No file exists at path \"" & filePath & "\""
|
setDesktopPicture.applescript
|
set picture of desktops to alias filePath
|
setDesktopPicture.applescript
|
end setDesktopPicture
|
setDesktopPicture.applescript
|
set mpt to my getMousePosition()
|
checkWindowSize.applescript
|
log my windowSize's getVisibleFrame(item 1 of mpt, item 2 of mpt)
|
checkWindowSize.applescript
|
on getMousePosition()
|
checkWindowSize.applescript
|
set cocoaScript to "require 'osx/cocoa';
|
checkWindowSize.applescript
|
event=OSX::CGEventCreate(nil);
|
checkWindowSize.applescript
|
pt = OSX::CGEventGetLocation(event);
|
checkWindowSize.applescript
|
print pt.x, '
|
checkWindowSize.applescript
|
',pt.y;
|
checkWindowSize.applescript
|
set ret to do shell script "/usr/bin/ruby -e " & quoted form of cocoaScript
|
checkWindowSize.applescript
|
return {paragraph 1 of ret as number, paragraph 2 of ret as number}
|
checkWindowSize.applescript
|
end getMousePosition
|
checkWindowSize.applescript
|
42 as text
|
as.applescript
|
"true" as boolean
|
as.applescript
|
"false" as boolean -- Or any string other than "True"
|
as.applescript
|
"16" as integer
|
as.applescript
|
(alias "Macintosh HD:Applications:TextEdit.app") as text
|
as.applescript
|
name of every menu of menu bar 1
|
Menu items.applescript
|
tell application "Safari" to quit
|
DesktopSetup.scpt
|
tell application "Mail" to quit
|
DesktopSetup.scpt
|
tell application "Calendar" to quit
|
DesktopSetup.scpt
|
tell application "Reminders" to quit
|
DesktopSetup.scpt
|
tell application "Notes" to quit
|
DesktopSetup.scpt
|
tell application "TextExpander" to quit
|
DesktopSetup.scpt
|
tell application "Reminders" to activate
|
DesktopSetup.scpt
|
tell application "Reminders" to set the bounds of the front window to {0, 0, 400, 500}
|
DesktopSetup.scpt
|
tell application "Notes" to activate
|
DesktopSetup.scpt
|
tell application "Notes" to set the bounds of the front window to {401, 0, 1000, 500}
|
DesktopSetup.scpt
|
tell application "Calendar" to activate
|
DesktopSetup.scpt
|
tell application "Calendar" to set the bounds of the front window to {0, 523, 1000, 1200}
|
DesktopSetup.scpt
|
tell application "TextExpander" to activate
|
DesktopSetup.scpt
|
tell application "Dropbox" to activate
|
DesktopSetup.scpt
|
tell application "Google Drive" to activate
|
DesktopSetup.scpt
|
tell application "Script Editor" to quit
|
DesktopSetup.scpt
|
on run {app_name, key_code, using_btn}
|
input_keycode.applescript
|
tell application "System Events" to tell process app_name
|
input_keycode.applescript
|
delay 0.3 # we have to wait for a while to make keystroke successful
|
input_keycode.applescript
|
key code key_code using using_btn
|
input_keycode.applescript
|
set plistFront to "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"><plist version=\"1.0\"><array>"
|
BibDesk-MavericksTags.scpt
|
set plistEnd to "</array></plist>"
|
BibDesk-MavericksTags.scpt
|
tell application "BibDesk"
|
BibDesk-MavericksTags.scpt
|
if (count of documents) = 0 then
|
BibDesk-MavericksTags.scpt
|
display dialog "No documents found." buttons {"•"} default button 1 giving up after 3
|
BibDesk-MavericksTags.scpt
|
set thePublications to the selection of document 1
|
BibDesk-MavericksTags.scpt
|
repeat with thePub in thePublications
|
BibDesk-MavericksTags.scpt
|
set currentKeywords to get keywords of thePub
|
BibDesk-MavericksTags.scpt
|
set {myTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {", "}}
|
BibDesk-MavericksTags.scpt
|
set tagList to text items of currentKeywords
|
BibDesk-MavericksTags.scpt
|
set AppleScript's text item delimiters to myTID
|
BibDesk-MavericksTags.scpt
|
set plistTagString to ""
|
BibDesk-MavericksTags.scpt
|
repeat with theTag in tagList
|
BibDesk-MavericksTags.scpt
|
set plistTagString to plistTagString & "<string>" & theTag & "</string>"
|
BibDesk-MavericksTags.scpt
|
set plistTagString to plistFront & plistTagString & plistEnd
|
BibDesk-MavericksTags.scpt
|
set theFiles to POSIX path of linked files of thePub
|
BibDesk-MavericksTags.scpt
|
repeat with f in theFiles
|
BibDesk-MavericksTags.scpt
|
do shell script "xattr -w com.apple.metadata:_kMDItemUserTags '" & plistTagString & "' " & quoted form of f
|
BibDesk-MavericksTags.scpt
|
set dialogReply to display dialog "Dialog Text" ¬
|
AppleScript_DialogAnswer.applescript
|
default answer "Text Answer" ¬
|
AppleScript_DialogAnswer.applescript
|
hidden answer false ¬
|
AppleScript_DialogAnswer.applescript
|
buttons {"Skip", "Okay", "Cancel"} ¬
|
AppleScript_DialogAnswer.applescript
|
default button "Okay" ¬
|
AppleScript_DialogAnswer.applescript
|
cancel button "Skip" ¬
|
AppleScript_DialogAnswer.applescript
|
with title "Dialog Window Title" ¬
|
AppleScript_DialogAnswer.applescript
|
with icon note ¬
|
AppleScript_DialogAnswer.applescript
|
giving up after 15
|
AppleScript_DialogAnswer.applescript
|
tell application "System Events" to set open_applications to name of every application process whose visible is true and background only is false and name is not "Script Editor"
|
closeall.scpt
|
repeat with apps in open_applications
|
closeall.scpt
|
quit application apps
|
closeall.scpt
|
do shell script "killall 'System Information'"
|
closeall.scpt
|
find "\\s*\\w*\\b" searching in text of front text window options {search mode:grep, wrap around:false, backwards:false, extend selection:true} with selecting match
|
Delete Word Forward.applescript
|
set selection of front text window to grep substitution of ""
|
Delete Word Forward.applescript
|
if current tab of front window exists then
|
Create Bookmark from Current Tab in Safari.applescript
|
set current_tab to current tab of front window
|
Create Bookmark from Current Tab in Safari.applescript
|
set js_script to "
|
Create Bookmark from Current Tab in Safari.applescript
|
var selection = window.getSelection().toString();
|
Create Bookmark from Current Tab in Safari.applescript
|
if (!selection) {
var meta = document.getElementsByTagName('meta');
for (var idx = 0; idx < meta.length; idx++) {
if (meta[idx].name.toLowerCase() === 'description') {
selection = meta[idx].content;
break;
}
|
Create Bookmark from Current Tab in Safari.applescript
|
selection;
|
Create Bookmark from Current Tab in Safari.applescript
|
set tab_title to name of current_tab
|
Create Bookmark from Current Tab in Safari.applescript
|
set tab_address to URL of current_tab
|
Create Bookmark from Current Tab in Safari.applescript
|
set tab_description to do JavaScript js_script in current_tab
|
Create Bookmark from Current Tab in Safari.applescript
|
show create bookmark panel with properties {url:tab_address, title:tab_title, desc:tab_description}
|
Create Bookmark from Current Tab in Safari.applescript
|
set numberOfCalendars to display dialog "How many calendars?" default answer ""
|
Export Calendars to ICS.applescript
|
set numberOfCalendars to text returned of numberOfCalendars
|
Export Calendars to ICS.applescript
|
set numberOfCalendars to numberOfCalendars as integer
|
Export Calendars to ICS.applescript
|
set numberOfCalendars to numberOfCalendars + 1
|
Export Calendars to ICS.applescript
|
repeat with i from 2 to numberOfCalendars
|
Export Calendars to ICS.applescript
|
tell row i of outline 1 of scroll area 1 of splitter group 1 of splitter group 1 of window 1
|
Export Calendars to ICS.applescript
|
set selected to true
|
Export Calendars to ICS.applescript
|
tell menu item 1 of menu of menu item "Export" of menu "File" of menu bar 1
|
Export Calendars to ICS.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.