text
stringlengths
0
15.7k
source
stringlengths
6
112
else if button returned of notifytime is "60" then
MenuStuff.applescript
delay 3540
MenuStuff.applescript
end runTheCode
MenuStuff.applescript
return 60 -- run every 60 seconds
MenuStuff.applescript
set defaults to current application's NSUserDefaults's standardUserDefaults
MenuStuff.applescript
set adjectives to {"mellow", "necessary", "silly", "relieved", "scattered", "gusty", "dangerous", "exuberant", "guttural", "uttermost", "kindly", "many", "annoyed", "rebel", "joyous", "makeshift", "ordinary", "purring", "juvenile", "tense", "maniacal", "purple", "dark", "flashy", "animated", "sore", "weary", "acceptabl...
Random Username.applescript
set nouns to {"tin", "dinosaurs", "peace", "string", "teaching", "woman", "beds", "thread", "bed", "mind", "trains", "appliance", "brick", "beef", "fog", "title", "waves", "children", "trees", "magic", "mass", "jellyfish", "bells", "cable", "playground", "art", "card", "tub", "distance", "badge", "ocean", "force", "fro...
Random Username.applescript
set num_adjectives to count of adjectives
Random Username.applescript
set random_number to (random number from 1 to num_adjectives)
Random Username.applescript
set adjective to item random_number of adjectives
Random Username.applescript
set num_nouns to count of nouns
Random Username.applescript
set random_number to (random number from 1 to num_nouns)
Random Username.applescript
set noun to item random_number of nouns
Random Username.applescript
set username to adjective & noun
Random Username.applescript
tell application "Evernote" to launch
Starting Shit Up!.applescript
set volume output volume 100 -- 输出音量最大
VolumeSet.applescript
set volume with output muted -- 输出音量静音
VolumeSet.applescript
end replaceTex
DEVONthink - Clipboard - Create universal index.applescript
set todayTasks to (flattened tasks where ((defer date < todayDate) and (completed is false)))
DeferredPullForward.applescript
set t's defer date to todayDate
DeferredPullForward.applescript
on create_db(file_path)
SQLiteModifier.applescript
set loc to space & file_path & space
SQLiteModifier.applescript
set head to "sqlite3" & loc & quote -- "head" is the opening statement of every future command to our db.-- "head" tells SQLite where to put our db if it doesn't exist, identifies it if it does.
SQLiteModifier.applescript
set tail to quote -- "tail" ends every query started with "head".
SQLiteModifier.applescript
do shell script head & tail -- And finally, build the SQLite query and execute it
SQLiteModifier.applescript
end create_db
SQLiteModifier.applescript
on create_table(file_path, table_name, column_ids)
SQLiteModifier.applescript
set head to "sqlite3" & loc & quote -- the "-line" option outputs the column data and heading one line at a time - useful for parsing the output for particular data items.
SQLiteModifier.applescript
set the_column_ids to TextParser's comma_delimited_text(column_ids)
SQLiteModifier.applescript
log "the_column_ids: " & the_column_ids
SQLiteModifier.applescript
set new_table to "create table " & table_name & "(" & the_column_ids & "); " --TODO: Create table should be a constant and in caps?
SQLiteModifier.applescript
do shell script head & new_table & tail
SQLiteModifier.applescript
on insert_row(file_path, table_name, keys, row) --todo rename row to values
SQLiteModifier.applescript
log "insert_row()"
SQLiteModifier.applescript
set head to "sqlite3" & loc & quote -- "head" tells SQLite where to put our db if it doesn't exist, identifies it if it does.-- "head" is the opening statement of every future command to our db.
SQLiteModifier.applescript
TextModifier's wrap_every_text_item(row, "'")
SQLiteModifier.applescript
set the_keys to TextParser's comma_delimited_text(keys)
SQLiteModifier.applescript
set the_row to TextParser's comma_delimited_text(row)
SQLiteModifier.applescript
set insert_command to "insert into " & table_name & "(" & the_keys & ")" & " values(" & the_row & "); "
SQLiteModifier.applescript
do shell script head & insert_command & tail -- And finally, build the SQLite query and execute it
SQLiteModifier.applescript
end insert_row
SQLiteModifier.applescript
on update_rows(file_path, table_name, conditions, input)
SQLiteModifier.applescript
set head to "sqlite3 -column" & loc & quote
SQLiteModifier.applescript
set the_input to SQLiteUtil's condition_procedure(input, ",")
SQLiteModifier.applescript
log "the_input: " & the_input
SQLiteModifier.applescript
set the_conditions to SQLiteUtil's condition_procedure(conditions, "AND")
SQLiteModifier.applescript
log "the_conditions: " & the_conditions
SQLiteModifier.applescript
set procedure to "update " & table_name & " set " & the_input & " where " & the_conditions & "; " -- country = 'England'
SQLiteModifier.applescript
log "procedure: " & procedure
SQLiteModifier.applescript
log head & procedure & tail
SQLiteModifier.applescript
do shell script head & procedure & tail
SQLiteModifier.applescript
end update_rows
SQLiteModifier.applescript
on update_row(file_path, table_name, condition, data_set)
SQLiteModifier.applescript
set the_condition to SQLiteUtil's condition_procedure(condition, "AND")
SQLiteModifier.applescript
log "the_condition: " & the_condition
SQLiteModifier.applescript
set the_data_set to SQLiteUtil's condition_procedure(data_set, "AND")
SQLiteModifier.applescript
log "the_data_set: " & the_data_set
SQLiteModifier.applescript
set procedure to "sqlite3" & space & file_path & space & quote & "UPDATE" & space & table_name & space & "SET" & space & the_data_set & space & "WHERE" & space & the_condition & ";" & quote
SQLiteModifier.applescript
do shell script procedure
SQLiteModifier.applescript
end update_row
SQLiteModifier.applescript
on remove_table(file_path, table_name)
SQLiteModifier.applescript
set procedure to "drop table " & table_name & "; "
SQLiteModifier.applescript
end remove_table
SQLiteModifier.applescript
on rename_table(file_path, table_name, new_table_name)
SQLiteModifier.applescript
set procedure to "sqlite3" & space & file_path & space & quote & "ALTER TABLE" & space & table_name & space & "RENAME TO" & space & new_table_name & ";" & quote
SQLiteModifier.applescript
end rename_table
SQLiteModifier.applescript
on transfer_table(file_path, from_table, to_table, from_column_keys, to_column_keys)
SQLiteModifier.applescript
set from_column_keys_string to TextParser's comma_delimited_text(from_column_keys)
SQLiteModifier.applescript
log "from_column_keys_string: " & from_column_keys_string
SQLiteModifier.applescript
set to_column_keys_string to TextParser's comma_delimited_text(to_column_keys)
SQLiteModifier.applescript
log "to_column_keys_string: " & to_column_keys_string
SQLiteModifier.applescript
set procedure to "sqlite3" & space & file_path & space & quote & "INSERT INTO" & space & to_table & "(" & to_column_keys_string & ")" & space & "SELECT" & space & from_column_keys_string & space & "FROM" & space & from_table & ";" & quote
SQLiteModifier.applescript
end transfer_table
SQLiteModifier.applescript
on rename_columns(file_path, table_name, old_column_names, new_column_names) --TODO rename to columnKey and newColumnKey
SQLiteModifier.applescript
log "rename_columns()"
SQLiteModifier.applescript
set column_names_string to SQLiteParser's column_names(file_path, table_name) --use the SQLiteParser's columnNames() to get the columnnames
SQLiteModifier.applescript
set temp_table_name to "_TEMP_TABLE_"
SQLiteModifier.applescript
rename_table(file_path, table_name, temp_table_name) --rename original table to "a temp name"
SQLiteModifier.applescript
set column_names to every item of column_names_string
SQLiteModifier.applescript
ListModifier's replace_many(column_names, old_column_names, new_column_names)
SQLiteModifier.applescript
create_table(file_path, table_name, column_names) --create a new table with the same columnNames, and replace the columnName with newColumnName
SQLiteModifier.applescript
transfer_table(file_path, temp_table_name, table_name, column_names_string, column_names) --use the transferTable method (figure out if you need the column name or if you can use the column name and meta data etc)
SQLiteModifier.applescript
remove_table(file_path, temp_table_name) --remove the temp table
SQLiteModifier.applescript
end rename_columns
SQLiteModifier.applescript
on swap_columns(file_path, table_name, coloumn_key_a, column_key_b)
SQLiteModifier.applescript
log "swap_columns()"
SQLiteModifier.applescript
swap_column_data(file_path, table_name, coloumn_key_a, column_key_b)
SQLiteModifier.applescript
swap_column_keys(file_path, table_name, coloumn_key_a, column_key_b)
SQLiteModifier.applescript
end swap_columns
SQLiteModifier.applescript
on swap_column_keys(file_path, table_name, coloumn_key_a, column_key_b)
SQLiteModifier.applescript
log "swap_column_keys"
SQLiteModifier.applescript
set new_colum_names to every item of column_names
SQLiteModifier.applescript
ListModifier's swap(new_colum_names, coloumn_key_a, column_key_b)
SQLiteModifier.applescript
log new_colum_names
SQLiteModifier.applescript
create_table(file_path, table_name, new_colum_names)
SQLiteModifier.applescript
transfer_table(file_path, temp_table_name, table_name, column_names, new_colum_names)
SQLiteModifier.applescript
end swap_column_keys
SQLiteModifier.applescript
on swap_column_data(file_path, table_name, coloumn_key_a, column_key_b)
SQLiteModifier.applescript
set procedure to "sqlite3" & space & file_path & space & quote & "UPDATE" & space & table_name & space & "SET" & space & coloumn_key_a & space & "=" & space & column_key_b & space & "," & space & column_key_b & space & "=" & space & coloumn_key_a & ";" & quote
SQLiteModifier.applescript
end swap_column_data
SQLiteModifier.applescript