text
stringlengths
0
15.7k
source
stringlengths
6
112
set the targetFileHFSPath to (defaultDestinationFolder as string) & newExportItemName
keynote to powerpoint.applescript
with timeout of 1200 seconds
keynote to powerpoint.applescript
export front document to file targetFileHFSPath as Microsoft PowerPoint
keynote to powerpoint.applescript
close front document without saving
keynote to powerpoint.applescript
on fileExists(posixPath)
keynote to powerpoint.applescript
return ((do shell script "if test -e " & quoted form of posixPath & "; then
keynote to powerpoint.applescript
echo 1;
keynote to powerpoint.applescript
echo 0;
keynote to powerpoint.applescript
fi") as integer) as boolean
keynote to powerpoint.applescript
global theLog
import people groups.applescript
set defName to "group_import_log" & theDate & ".txt"
import people groups.applescript
set outputFileName to choose file name with prompt "Save import log as text:" default name defName
import people groups.applescript
set outputFileName to choose file with prompt "Select address book group export:"
import people groups.applescript
set outputFile to open for access outputFileName
import people groups.applescript
set theLineList to read outputFile using delimiter "
import people groups.applescript
theLineList
import people groups.applescript
set theLog to ""
import people groups.applescript
set AppleScript's text item delimiters to {"|"}
import people groups.applescript
repeat with theLine in theLineList
import people groups.applescript
if i mod 50 is 0 then
import people groups.applescript
log "Processed " & i & " entries."
import people groups.applescript
if i is greater than 11 then
import people groups.applescript
set t1 to "003002EA-D364-46C4-8C6C-E337CDD35D58:ABPerson, Hamm, Robert, false, Director, Network Operations, Phone, 40C93616-63C1-4E60-98CD-273F7C24784E:ABGroup" -- bad line! Organization messed things up.
import people groups.applescript
set t2a to "00AC7820-44DC-4186-9C72-2FF83380090D:ABPerson, Gebhardt, Mark, false, missing value, Politics, 08B3B6C2-40B7-4D57-B2B5-E191B02286FD:ABGroup"
import people groups.applescript
set t2b to "00AC7820-44DC-4186-9C72-2FF83380090D:ABPerson, Gebhardt, Mark, false, missing value, Baby Announce2, 526D82D2-E5F5-46D0-A19C-5CE775612108:ABGroup"
import people groups.applescript
set thePeople to (every person whose id = text item 1 of theLine)
import people groups.applescript
if length of thePeople is 0 then
import people groups.applescript
my logg(get "PERSON NOT FOUND " & theLine)
import people groups.applescript
set theGroup to (every group whose name = text item 6 of theLine)
import people groups.applescript
if length of theGroup is 0 then
import people groups.applescript
my logg(get "GROUP NOT FOUND " & theLine)
import people groups.applescript
else if length of theGroup > 1 then
import people groups.applescript
my logg(get "TOO MANY GROUPS FOUND " & theLine)
import people groups.applescript
my logg("Adding " & name of item 1 of thePeople & " to group " & name of item 1 of theGroup)
import people groups.applescript
save addressbook
import people groups.applescript
theLog
import people groups.applescript
write theLog to outputFile
import people groups.applescript
on logg(str)
import people groups.applescript
set theLog to theLog & return & str
import people groups.applescript
end logg
import people groups.applescript
set page to display name editor "Man page" info "Enter the man page to import:"
Man Page.applescript
if page is not "" then exit repeat
Man Page.applescript
show progress indicator "Converting man page to PDF ..." steps -1
Man Page.applescript
set strPDF to "~/" & page & ".pdf"
Man Page.applescript
set strCmd to "man -t " & (quoted form of page) & " | pstopdf -i -o " & strPDF
Man Page.applescript
do shell script strCmd
Man Page.applescript
tell application id "com.apple.finder"
Man Page.applescript
set strTmpPath to (((path to home folder) as text) & page & ".pdf")
Man Page.applescript
set blnExists to exists strTmpPath
Man Page.applescript
if blnExists then
Man Page.applescript
import strPDF name page to current group
Man Page.applescript
tell application id "com.apple.finder" to delete file strTmpPath
Man Page.applescript
error "Page does not exist."
Man Page.applescript
hide progress indicator
Man Page.applescript
set desiredPosition to {0.0, 0.5}
30 - ⬇️ … Bottom Half.scpt
set desiredSize to {1.0, 0.5}
30 - ⬇️ … Bottom Half.scpt
set myButtonList to {"Desktop", "Window", "Selected Area"}
Copy%20Screenshot.scpt
set response to button returned of (display dialog "Take screenshot of..." buttons {item 1 of myButtonList, item 2 of myButtonList, item 3 of myButtonList})
Copy%20Screenshot.scpt
if response = item 1 of myButtonList then
Copy%20Screenshot.scpt
set options to "-c"
Copy%20Screenshot.scpt
else if response = item 2 of myButtonList then
Copy%20Screenshot.scpt
set options to "-Woc"
Copy%20Screenshot.scpt
else if response = item 3 of myButtonList then
Copy%20Screenshot.scpt
set options to "-sc"
Copy%20Screenshot.scpt
do shell script "screencapture " & options
Copy%20Screenshot.scpt
tell application "Microsoft Outlook"
Go online.scpt
if working offline is true then
Go online.scpt
display dialog "Take Microsoft Outlook online?"
Go online.scpt
set working offline to false
Go online.scpt
use omnilib : script "omnifocuslib"
editlinks.applescript
repeat with taskone in omnilib's getSelectedActions()
editlinks.applescript
repeat with t in (every attribute run of note of taskone where value of its style's attribute "link" is not "")
editlinks.applescript
set txt to text of t
editlinks.applescript
set dialogResult to (display dialog "Edit Link" default answer txt with icon 1)
editlinks.applescript
set text of t to text returned of dialogResult
editlinks.applescript
repeat with i from 1 to the count of sources
Return info on Audio CD.applescript
if kind of source i is audio CD then
Return info on Audio CD.applescript
set theCD to audio CD playlist 1 of source i
Return info on Audio CD.applescript
set CDal to theCD's name
Return info on Audio CD.applescript
set CDar to theCD's artist
Return info on Audio CD.applescript
set CDye to theCD's year
Return info on Audio CD.applescript
set CDge to theCD's genre
Return info on Audio CD.applescript
set CDco to theCD's composer
Return info on Audio CD.applescript
set CDdn to disc number of theCD
Return info on Audio CD.applescript
set CDdc to disc count of theCD
Return info on Audio CD.applescript
set CDcomp to theCD's composer
Return info on Audio CD.applescript
set theTracks to tracks of theCD
Return info on Audio CD.applescript
tell application "System Events" to set scriptName to get name of (path to me)
hello-with-log-boundery.applescript
set logger to std's import("logger")'s new(scriptName)
hello-with-log-boundery.applescript
logger's info("Hello AppleScript Core!")
hello-with-log-boundery.applescript
set mylist to {}
Boxes -move imageboxes.applescript
set a to display dialog "Odd pages" default answer "10, 10"
Boxes -move imageboxes.applescript
set b to text returned of a
Boxes -move imageboxes.applescript
set c to display dialog "Even pages" default answer "20, 20"
Boxes -move imageboxes.applescript
set d to text returned of c
Boxes -move imageboxes.applescript
repeat with i from 1 to count of pages
Boxes -move imageboxes.applescript
set whichside to i mod 2
Boxes -move imageboxes.applescript
if whichside = 1 then
Boxes -move imageboxes.applescript
set cBoxBounds to b
Boxes -move imageboxes.applescript
set cBoxBounds to d
Boxes -move imageboxes.applescript