text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set AppleScript's text item delimiters to (_delimsNew)
|
AppleScript_finderLib.applescript
|
set _name to (name of _item)
|
AppleScript_finderLib.applescript
|
set _nameLength to (length of _name)
|
AppleScript_finderLib.applescript
|
set _ext to (name extension of _item)
|
AppleScript_finderLib.applescript
|
set _extLength to (length of _ext)
|
AppleScript_finderLib.applescript
|
if _extLength is not 0 then
|
AppleScript_finderLib.applescript
|
set _basenameLength to (_nameLength - (_extLength + 1))
|
AppleScript_finderLib.applescript
|
set _basename to ((text items 1 thru _basenameLength) of _name)
|
AppleScript_finderLib.applescript
|
set _ext to ("")
|
AppleScript_finderLib.applescript
|
set _extLength to (0)
|
AppleScript_finderLib.applescript
|
set _basename to (_name as string)
|
AppleScript_finderLib.applescript
|
set _extension to _ext
|
AppleScript_finderLib.applescript
|
set _basename to _basename
|
AppleScript_finderLib.applescript
|
set _nameList to {_basename, _extension}
|
AppleScript_finderLib.applescript
|
return _nameList
|
AppleScript_finderLib.applescript
|
set AppleScript's text item delimiters to _delimsOld
|
AppleScript_finderLib.applescript
|
end getNameAndExt
|
AppleScript_finderLib.applescript
|
on getCommentOfItem(_item)
|
AppleScript_finderLib.applescript
|
set _comment to comment of _item
|
AppleScript_finderLib.applescript
|
return _comment
|
AppleScript_finderLib.applescript
|
end getCommentOfItem
|
AppleScript_finderLib.applescript
|
on getContainerOfItem(_item)
|
AppleScript_finderLib.applescript
|
set _container to container of _item
|
AppleScript_finderLib.applescript
|
return _container
|
AppleScript_finderLib.applescript
|
end getContainerOfItem
|
AppleScript_finderLib.applescript
|
on getPropertiesOfItem(_item)
|
AppleScript_finderLib.applescript
|
set _properties to properties of _item
|
AppleScript_finderLib.applescript
|
return _properties
|
AppleScript_finderLib.applescript
|
end getPropertiesOfItem
|
AppleScript_finderLib.applescript
|
on getParentAlias(_alias)
|
AppleScript_finderLib.applescript
|
set _parent to POSIX file ((POSIX path of _alias) & "/..") as alias
|
AppleScript_finderLib.applescript
|
end getParentAlias
|
AppleScript_finderLib.applescript
|
on appendBasenamesToParentPOSIX(_basenames, _parentPosix)
|
AppleScript_finderLib.applescript
|
if ¬
|
AppleScript_finderLib.applescript
|
length of (_basenames as string) is not 0 and ¬
|
AppleScript_finderLib.applescript
|
length of (_parentPosix as string) is not 0 then
|
AppleScript_finderLib.applescript
|
set _newPaths to {}
|
AppleScript_finderLib.applescript
|
set _quotedForm to false
|
AppleScript_finderLib.applescript
|
set _newDelims to ""
|
AppleScript_finderLib.applescript
|
set _oldDelims to AppleScript's text item delimiters
|
AppleScript_finderLib.applescript
|
set AppleScript's text item delimiters to _newDelims
|
AppleScript_finderLib.applescript
|
set _parentString to _parentPosix as string
|
AppleScript_finderLib.applescript
|
set _item1 to _parentString's first text item
|
AppleScript_finderLib.applescript
|
set _itemN to _parentString's last text item
|
AppleScript_finderLib.applescript
|
if _item1 is "'" and _itemN is "'" then
|
AppleScript_finderLib.applescript
|
set _quotedForm to true
|
AppleScript_finderLib.applescript
|
set _parentString to text items 2 thru -2 of _parentString
|
AppleScript_finderLib.applescript
|
repeat with _bname in _basenames
|
AppleScript_finderLib.applescript
|
set _string to _bname as string
|
AppleScript_finderLib.applescript
|
set _itemA to _string's first text item
|
AppleScript_finderLib.applescript
|
set _itemZ to _string's last text item
|
AppleScript_finderLib.applescript
|
if _itemA is "'" and _itemZ is "'" then
|
AppleScript_finderLib.applescript
|
set _string to text items 2 thru -2 of _string
|
AppleScript_finderLib.applescript
|
set _itemPath to (_parentString & _string) as string
|
AppleScript_finderLib.applescript
|
if _quotedForm is true then
|
AppleScript_finderLib.applescript
|
set _itemPath to quoted form of _itemPath
|
AppleScript_finderLib.applescript
|
set end of _newPaths to _itemPath
|
AppleScript_finderLib.applescript
|
set AppleScript's text item delimiters to _oldDelims
|
AppleScript_finderLib.applescript
|
return _newPaths
|
AppleScript_finderLib.applescript
|
end appendBasenamesToParentPOSIX
|
AppleScript_finderLib.applescript
|
do shell script "sips -s format jpeg -s formatOptions 80 " & thePathShell
|
JPG compress 80%.applescript
|
set choosen_time to choose from list ¬
|
Caffeinate.applescript
|
{"30 minutes", "1 hour", "2 hours"} with title "Caffeninate" with prompt ¬
|
Caffeinate.applescript
|
"Keep this mac awake for:" default items ¬
|
Caffeinate.applescript
|
{"1 hour"} without multiple selections allowed
|
Caffeinate.applescript
|
if choosen_time contains "30 minutes" then
|
Caffeinate.applescript
|
do shell script "/usr/bin/caffeinate -s -t 1800 &> /dev/null &"
|
Caffeinate.applescript
|
else if choosen_time contains "1 hour" then
|
Caffeinate.applescript
|
do shell script "/usr/bin/caffeinate -s -t 3600 &> /dev/null &"
|
Caffeinate.applescript
|
else if choosen_time contains "2 hours" then
|
Caffeinate.applescript
|
do shell script "/usr/bin/caffeinate -s -t 7200 &> /dev/null &"
|
Caffeinate.applescript
|
Run Shell
|
dec-terminal-run.applescript
|
Change Directory
|
dec-terminal-run.applescript
|
logger's infof("Run echo command: {}", sut's runShell("echo hello"))
|
dec-terminal-run.applescript
|
set AccountName2 to "iCloud"
|
Email%20to%20Reminder%20-%20Set%20&%20Check.applescript
|
set AccountName3 to "iCloud"
|
Email%20to%20Reminder%20-%20Set%20&%20Check.applescript
|
set theReminder to last reminder whose body is theUrl and completed is false
|
Email%20to%20Reminder%20-%20Set%20&%20Check.applescript
|
set theButton to button returned of (display dialog "The selected email matches a completed reminder, would you like to clear the flag of this message?" with title "Clear Reminder Flag" buttons {"Mark complete", "Cancel"} default button 1)
|
Email%20to%20Reminder%20-%20Set%20&%20Check.applescript
|
else if the_button is "Cancel" then
|
Email%20to%20Reminder%20-%20Set%20&%20Check.applescript
|
display dialog "No Reminder Found!" with title "Reminder Check" buttons {"OK"} default button 1
|
Email%20to%20Reminder%20-%20Set%20&%20Check.applescript
|
set remindMeDate to (date (text returned of (display dialog (localized string "Enter the due date (e.g. 1/4/2017)") default answer "")))
|
Email%20to%20Reminder%20-%20Set%20&%20Check.applescript
|
set _path to (path of movies folder) as string
|
Movies.applescript
|
on every_word(the_text)
|
TextParser.applescript
|
return every word of the_text
|
TextParser.applescript
|
end every_word
|
TextParser.applescript
|
on every_paragraph(the_text)
|
TextParser.applescript
|
set paragraph_list to {}
|
TextParser.applescript
|
set para_list to paragraphs of the_text
|
TextParser.applescript
|
repeat with next_line in para_list
|
TextParser.applescript
|
if length of next_line is greater than 0 then -- this takes care of not adding an emty item at the end
|
TextParser.applescript
|
copy next_line to the end of paragraph_list
|
TextParser.applescript
|
return paragraph_list
|
TextParser.applescript
|
end every_paragraph
|
TextParser.applescript
|
on split(the_text, delimiter)
|
TextParser.applescript
|
set text item delimiters to delimiter
|
TextParser.applescript
|
set ret_val to every text item of the_text
|
TextParser.applescript
|
set text item delimiters to "," --reset applescript delimiter to default
|
TextParser.applescript
|
return ret_val
|
TextParser.applescript
|
on text_length(the_text)
|
TextParser.applescript
|
return length of the_text
|
TextParser.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.