text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set the dialogMessage to "Enter the number of columns to add:"
|
lns3.scpt
|
set columnCount to (length of the headerTitles) + 1
|
lns3.scpt
|
set the dialogMessage to "Enter the number of rows to add:"
|
lns3.scpt
|
display dialog dialogMessage default answer "3"
|
lns3.scpt
|
set the elementCount to the text returned of the result as integer
|
lns3.scpt
|
if the elementCount is greater than 0 then
|
lns3.scpt
|
set columnCount to elementCount + 1
|
lns3.scpt
|
set rowCount to elementCount + 1
|
lns3.scpt
|
on error number errorNumber
|
lns3.scpt
|
if errorNumber is -128 then error number -128
|
lns3.scpt
|
set thisTable to ¬
|
lns3.scpt
|
make new table with properties ¬
|
lns3.scpt
|
{row count:rowCount, column count:columnCount}
|
lns3.scpt
|
repeat with i from 1 to the count of the headerTitles
|
lns3.scpt
|
set thisHeaderTitle to item i of the headerTitles
|
lns3.scpt
|
set the value of cell 1 of row (i + 1) to thisHeaderTitle
|
lns3.scpt
|
set the value of cell 1 of column (i + 1) to thisHeaderTitle
|
lns3.scpt
|
set the alignment of row 1 to center
|
lns3.scpt
|
if the (count of cells of selection range) is not 1 then ¬
|
lns3.scpt
|
error number 1002
|
lns3.scpt
|
set cellID to the name of item 1 of selection range
|
lns3.scpt
|
if address of row of cell cellID is less than or equal to 2 or ¬
|
lns3.scpt
|
address of column of cell cellID is 1 then error number 1003
|
lns3.scpt
|
set taskName to the formatted value of cell 1 of row of cell cellID
|
lns3.scpt
|
set sessionDate to the value of cell 1 of column of cell cellID
|
lns3.scpt
|
set sessionTimeString to ¬
|
lns3.scpt
|
the formatted value of cell 2 of column of cell cellID
|
lns3.scpt
|
set startHour to (word -4 of sessionTimeString) as integer
|
lns3.scpt
|
set startMinute to (word -3 of sessionTimeString) as integer
|
lns3.scpt
|
set endHour to (word -2 of sessionTimeString) as integer
|
lns3.scpt
|
set endMinute to (word -1 of sessionTimeString) as integer
|
lns3.scpt
|
copy sessionDate to startTime
|
lns3.scpt
|
set hours of startTime to startHour
|
lns3.scpt
|
set minutes of startTime to startMinute
|
lns3.scpt
|
set seconds of startTime to 0
|
lns3.scpt
|
copy sessionDate to endTime
|
lns3.scpt
|
set hours of endTime to endHour
|
lns3.scpt
|
set minutes of endTime to endMinute
|
lns3.scpt
|
set seconds of endTime to 0
|
lns3.scpt
|
set userName to long user name of (get system info)
|
lns3.scpt
|
set firstName to word 1 of userName
|
lns3.scpt
|
set value of cell cellID to firstName
|
lns3.scpt
|
set the background color of cell cellID to {38390, 64038, 22477}
|
lns3.scpt
|
set calendarID to ¬
|
lns3.scpt
|
(do shell script "defaults read com.apple.iCal CalDefaultCalendar")
|
lns3.scpt
|
if calendarID is "UseLastSelectedAsDefaultCalendar" then
|
lns3.scpt
|
set defaultCalendar to calendar 1
|
lns3.scpt
|
set defaultCalendar to first calendar whose uid is calendarID
|
lns3.scpt
|
tell defaultCalendar
|
lns3.scpt
|
set newEvent to make new event with properties ¬
|
lns3.scpt
|
{summary:taskName, start date:startTime, end date:endTime}
|
lns3.scpt
|
show newEvent
|
lns3.scpt
|
set alertString to (errorNumber as string) & space & "MISSING RESOURCE"
|
lns3.scpt
|
"Please create or open a document before running this script."
|
lns3.scpt
|
"Please select a single cell in a table before running this script."
|
lns3.scpt
|
"Please select a single cell in the table before running this script."
|
lns3.scpt
|
"Please select a single cell in the table that is not in a row or column header."
|
lns3.scpt
|
tell application "Bookends"
|
lns3.scpt
|
set groupName to "My Papers" -- adopt to your needs
|
lns3.scpt
|
set outFile to ((path to desktop from user domain) as string) & "Bibliography.ris"
|
lns3.scpt
|
tell front library window
|
lns3.scpt
|
set pubsList to publication items of group item groupName
|
lns3.scpt
|
if pubsList is not {} then
|
lns3.scpt
|
set risContent to format pubsList using "RIS.fmt"
|
lns3.scpt
|
my writeTextToFile(outFile, risContent)
|
lns3.scpt
|
set theMailCount to (count of theMessages)
|
lns3.scpt
|
repeat with counter from 1 to theMailCount
|
lns3.scpt
|
set msg to item counter of theMessages
|
lns3.scpt
|
set theAttachmentCount to (count of mail attachments of msg)
|
lns3.scpt
|
set _title to subject of msg
|
lns3.scpt
|
set _sender to sender of msg
|
lns3.scpt
|
set _notes to the content of msg
|
lns3.scpt
|
set _combined to "message://%3c" & msg's message id & "%3e" & return & return & _title & return & return & _notes
|
lns3.scpt
|
set theContext to (first flattened context where its name = "Computer")
|
lns3.scpt
|
set newTask to make new inbox task with properties {name:"Add tracking number to package tracking application.", note:_combined, flagged:true, context:theContext}
|
lns3.scpt
|
display dialog "Show information for images or profiles."
|
lns3.scpt
|
set chosenFile to choose file with prompt "Choose an image or profile" default location path to desktop folder
|
lns3.scpt
|
open chosenFile
|
lns3.scpt
|
on open draggedItems
|
lns3.scpt
|
repeat with thisFile in (draggedItems as list)
|
lns3.scpt
|
set filePosixPath to quoted form of POSIX path of thisFile
|
lns3.scpt
|
set cmdLine to ("sips -g all " & filePosixPath) as string
|
lns3.scpt
|
set infoString to do shell script cmdLine
|
lns3.scpt
|
display dialog infoString
|
lns3.scpt
|
on xmlvalue(theString, theItem)
|
lns3.scpt
|
set newPlistItem to make new property list item with data theString
|
lns3.scpt
|
return value of property list item theItem of newPlistItem
|
lns3.scpt
|
end xmlvalue
|
lns3.scpt
|
display dialog "Set image or profile properties."
|
lns3.scpt
|
set chosenFile to choose file with prompt "Choose a color profile" default location path to desktop folder
|
lns3.scpt
|
display dialog "Example only. Drag this application onto Script Editor to edit."
|
lns3.scpt
|
set theTag to quoted form of "quality"
|
lns3.scpt
|
set theValue to quoted form of "best"
|
lns3.scpt
|
set filePosixPathNew to quoted form of (POSIX path of thisFile & " new") as string
|
lns3.scpt
|
set cmdLine to ("sips -s " & theTag & " " & theValue & " " & filePosixPath & " --out " & filePosixPathNew) as string
|
lns3.scpt
|
display dialog "Change a profile's description string."
|
lns3.scpt
|
set chosenFile to choose file with prompt "Choose a profile" default location POSIX file "/Library/ColorSync/Profiles"
|
lns3.scpt
|
tell application "Finder" to set fileName to name of thisFile
|
lns3.scpt
|
set filePath to quoted form of POSIX path of thisFile
|
lns3.scpt
|
set cmdLine to ("sips -g allxml " & filePath) as string
|
lns3.scpt
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.