text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
for line in lines:
|
Normalize table.applescript
|
line = line.strip(' ')
|
Normalize table.applescript
|
if line[0] == '|': line = line[1:]
|
Normalize table.applescript
|
if line[-1] == '|': line = line[:-1]
|
Normalize table.applescript
|
cells = line.split('|')
|
Normalize table.applescript
|
linecontent = [ ' ' + x.strip() + ' ' for x in cells ]
|
Normalize table.applescript
|
content.append(linecontent)
|
Normalize table.applescript
|
rows = len(content)
|
Normalize table.applescript
|
while len(content[i]) < columns:
|
Normalize table.applescript
|
content[i].append('')
|
Normalize table.applescript
|
widths = [2] * columns
|
Normalize table.applescript
|
for row in content:
|
Normalize table.applescript
|
for i in range(columns):
|
Normalize table.applescript
|
widths[i] = max(len(row[i].decode(" & quote & "utf-8" & quote & ")), widths[i])
|
Normalize table.applescript
|
formatted = []
|
Normalize table.applescript
|
formatted.append('|' + '|'.join([ just(s, t, n) for (s, t, n) in zip(row, justify, widths) ]) + '|')
|
Normalize table.applescript
|
formatline = '|' + '|'.join([ s[0] + '-'*(n-2) + s[-1] for (s, n) in zip(justify, widths) ]) + '|'
|
Normalize table.applescript
|
formatted.insert(formatrow, formatline)
|
Normalize table.applescript
|
return '\\n'.join(formatted)
|
Normalize table.applescript
|
print normtable(unformatted).encode('utf-8')"
|
Normalize table.applescript
|
set the clipboard to (do shell script "python -c '" & theScript & "'")
|
Normalize table.applescript
|
set the clipboard to errmsg
|
Normalize table.applescript
|
display alert "Oops" message errmsg
|
Normalize table.applescript
|
global kColorValueMaximum
|
gistfile1-2 copy 3.scpt
|
set kColorValueMaximum to 32767
|
gistfile1-2 copy 3.scpt
|
set randomRed to (random number) * kColorValueMaximum
|
gistfile1-2 copy 3.scpt
|
set randomGreen to (random number) * kColorValueMaximum
|
gistfile1-2 copy 3.scpt
|
set randomBlue to (random number) * kColorValueMaximum
|
gistfile1-2 copy 3.scpt
|
set myBackgroundColor to {randomRed, randomGreen, randomBlue}
|
gistfile1-2 copy 3.scpt
|
set current_terminal to (current terminal)
|
gistfile1-2 copy 3.scpt
|
tell current_terminal
|
gistfile1-2 copy 3.scpt
|
set current_session to (current session)
|
gistfile1-2 copy 3.scpt
|
tell current_session
|
gistfile1-2 copy 3.scpt
|
set background color to myBackgroundColor
|
gistfile1-2 copy 3.scpt
|
set the_Sel to selection
|
Found Artist Ratios.applescript
|
set found_albums to {}
|
Found Artist Ratios.applescript
|
set found_genres to {}
|
Found Artist Ratios.applescript
|
repeat with anSong in the_Sel
|
Found Artist Ratios.applescript
|
set this_album to album of anSong
|
Found Artist Ratios.applescript
|
if found_albums does not contain this_album then
|
Found Artist Ratios.applescript
|
set found_albums to found_albums & this_album
|
Found Artist Ratios.applescript
|
repeat with this_album in found_albums
|
Found Artist Ratios.applescript
|
set these_Found_Tracks to (tracks whose album is this_album)
|
Found Artist Ratios.applescript
|
set these_FTCount to count of these_Found_Tracks
|
Found Artist Ratios.applescript
|
set found_album_artists to {}
|
Found Artist Ratios.applescript
|
set artistReccordArray to {}
|
Found Artist Ratios.applescript
|
repeat with an_Found_Track in these_Found_Tracks
|
Found Artist Ratios.applescript
|
if kind of an_Found_Track contains "audio" then
|
Found Artist Ratios.applescript
|
set fnd_alb_art to artist of an_Found_Track
|
Found Artist Ratios.applescript
|
if found_album_artists does not contain fnd_alb_art then
|
Found Artist Ratios.applescript
|
set found_album_artists to found_album_artists & fnd_alb_art
|
Found Artist Ratios.applescript
|
set artistReccordArray to artistReccordArray & {{name:fnd_alb_art, found:count of (tracks whose album is this_album and artist is fnd_alb_art)}}
|
Found Artist Ratios.applescript
|
if (count of found_album_artists) > 1 then
|
Found Artist Ratios.applescript
|
set max_art to ""
|
Found Artist Ratios.applescript
|
set max_found to 0
|
Found Artist Ratios.applescript
|
repeat with anRecord in artistReccordArray
|
Found Artist Ratios.applescript
|
if found of anRecord > max_found then
|
Found Artist Ratios.applescript
|
set max_found to found of anRecord
|
Found Artist Ratios.applescript
|
set max_art to name of anRecord
|
Found Artist Ratios.applescript
|
tell an_Found_Track
|
Found Artist Ratios.applescript
|
set {episode ID, show} to {max_art, ((max_found / these_FTCount * 1000) as integer) / 1000}
|
Found Artist Ratios.applescript
|
duplicate an_Found_Track to playlist "ORG - Mixed Album"
|
Found Artist Ratios.applescript
|
duplicate an_Found_Track to playlist "ORG - Pure Album"
|
Found Artist Ratios.applescript
|
if application "Visual Studio Code - Insiders" is frontmost then
|
Open Settings.applescript
|
do shell script "/usr/local/bin/code-insiders --new-window ~/Library/Application\\ Support/Code\\ -\\ Insiders/User"
|
Open Settings.applescript
|
do shell script "/usr/local/bin/code --new-window ~/Library/Application\\ Support/Code/User"
|
Open Settings.applescript
|
tell application "System Events" to keystroke "l" using {command down, option down} # cmd-opt-l
|
Spacebar.applescript
|
tell application "System Events" to key code 49 #space
|
Spacebar.applescript
|
set dued to text returned of (display dialog "How many days and hours from now?" default answer "" buttons {"OK"} default button "OK")
|
dued.applescript
|
if dued is "help" then
|
dued.applescript
|
open location "https://github.com/unforswearing/dued/blob/master/help.md"
|
dued.applescript
|
tell current application to display notification "opening help page..."
|
dued.applescript
|
if dued is "" then error number -128
|
dued.applescript
|
set dued to words of dued
|
dued.applescript
|
set dayss to item 1 of dued
|
dued.applescript
|
if dayss is "h" then
|
dued.applescript
|
set hourss to item 2 of dued
|
dued.applescript
|
set morrow to morrow + hourss * hours
|
dued.applescript
|
set morrow to morrow as text
|
dued.applescript
|
set dtoday to (do shell script "echo " & morrow & " | sed s/.*,// | sed s/20..// | sed s/:[^..][0-9]//g | sed s/.' '//")
|
dued.applescript
|
set dtoday to "Today at " & dtoday
|
dued.applescript
|
set the clipboard to dtoday
|
dued.applescript
|
tell current application to display notification "Today's due time has been copied to the clipboard"
|
dued.applescript
|
else if (count of dued) is 1 then
|
dued.applescript
|
set hourss to "0"
|
dued.applescript
|
if dayss is "0" then
|
dued.applescript
|
set the clipboard to (do shell script "echo " & morrow & " | sed s/:[^..][0-9]//g | sed s/20..// | sed s/,[^,]*$//")
|
dued.applescript
|
tell current application to display notification "Today's date has been copied to the clipboard"
|
dued.applescript
|
else if dayss is greater than "0" then
|
dued.applescript
|
tell current application to display notification "The due date has been copied to the clipboard"
|
dued.applescript
|
else if (count of dued) is 2 then
|
dued.applescript
|
if dayss is "y" then
|
dued.applescript
|
set past to item 2 of dued
|
dued.applescript
|
set past to "-" & past
|
dued.applescript
|
set morrow to morrow + past * days
|
dued.applescript
|
tell current application to display notification "The past date has been copied to the clipboard"
|
dued.applescript
|
else if dayss is not "y" then
|
dued.applescript
|
set the clipboard to (do shell script "echo " & morrow & " | sed s/:[^..][0-9]//g | sed s/20..// | sed s/' '//3")
|
dued.applescript
|
tell current application to display notification "The due date and time has been copied to the clipboard"
|
dued.applescript
|
set value11 to missing value
|
get chrome url.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.