text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set passwordv to "-p" & quoted form of passwordv
|
MySQL.applescript
|
set passwordv to ""
|
MySQL.applescript
|
set cmd to cmd & " " & passwordv
|
MySQL.applescript
|
set resultat to do shell script cmd
|
MySQL.applescript
|
if resultat starts with "ERROR " then
|
MySQL.applescript
|
error ("MySQL " & resultat) number 9998
|
MySQL.applescript
|
return resultat
|
MySQL.applescript
|
end _mySQLCLIWrapper
|
MySQL.applescript
|
on _mySQLReplaceInString(instr, whatstr, repstr)
|
MySQL.applescript
|
return ((current application's NSString's stringWithString:instr)'s stringByReplacingOccurencesOfString:whatstr withString:repstr) as text
|
MySQL.applescript
|
end _mySQLReplaceInString
|
MySQL.applescript
|
on _mySQLSecurifyArgument(strArg)
|
MySQL.applescript
|
set resultat to "\"" & _mySQLReplaceInString(strArg, "\"", "\\\"") & "\""
|
MySQL.applescript
|
end _mySQLSecurifyArgument
|
MySQL.applescript
|
on connect into hostname given username:username, password:passwordv
|
MySQL.applescript
|
set conver to {host:hostname, usern:username, password:passwordv}
|
MySQL.applescript
|
_mySQLCLIWrapper(hostname, usern of conver, password of conver, "SELECT 1")
|
MySQL.applescript
|
return conver
|
MySQL.applescript
|
end connect
|
MySQL.applescript
|
on _mySQLJoinStringList(listing, sepv)
|
MySQL.applescript
|
if class of listing is not list then
|
MySQL.applescript
|
return listing as text
|
MySQL.applescript
|
set resultat to ""
|
MySQL.applescript
|
set firstv to true
|
MySQL.applescript
|
repeat with itm in listing
|
MySQL.applescript
|
set itm to itm as text
|
MySQL.applescript
|
if firstv then
|
MySQL.applescript
|
set resultat to itm
|
MySQL.applescript
|
set firstv to false
|
MySQL.applescript
|
set resultat to resultat & sepv & " " & itm
|
MySQL.applescript
|
end _mySQLJoinStringList
|
MySQL.applescript
|
on _mySQLReallyFastSplit(str, delims)
|
MySQL.applescript
|
set resultat to every text item of str
|
MySQL.applescript
|
end _mySQLReallyFastSplit
|
MySQL.applescript
|
on select of table given connection:serverConfig, database:dbName, columns:columnsList, filter:whereConditionsList
|
MySQL.applescript
|
set query to "SELECT " & _mySQLJoinStringList(columnsList, ",") & " FROM `" & dbName & "`.`" & table & "`"
|
MySQL.applescript
|
if (length of whereConditionsList) is greater than 1 then
|
MySQL.applescript
|
set query to query & " WHERE " & _mySQLJoinStringList(columnsList, " AND")
|
MySQL.applescript
|
set wrapperOut to _mySQLCLIWrapper(host of serverConfig, usern of serverConfig, password of serverConfig, query)
|
MySQL.applescript
|
set resultatTmp to _mySQLReallyFastSplit(wrapperOut, {(ASCII character 10), (ASCII character 13)})
|
MySQL.applescript
|
set resultat to {}
|
MySQL.applescript
|
set columnsAvailable to {}
|
MySQL.applescript
|
set rowCount to -1
|
MySQL.applescript
|
repeat with ln in resultatTmp
|
MySQL.applescript
|
set splitLn to _mySQLReallyFastSplit(ln, tab)
|
MySQL.applescript
|
set columnsAvailable to splitLn
|
MySQL.applescript
|
set outputEval to "{"
repeat with i from 1 to (length of splitLn)
set vv to ((item i of splitLn) as text)
set pair to ((item i of columnsAvailable) as text) & ":\"" & vv & "\","
if vv is not equal to "NULL" then
set outputEval to outputEval & pair
end if
end repeat
set outputEval to outputEval & "__mysqlConnector_row:" & rowCount & "}"
|
MySQL.applescript
|
set recordv to run script outputEval
|
MySQL.applescript
|
set end of resultat to recordv
|
MySQL.applescript
|
end select
|
MySQL.applescript
|
on _mySQLConvertIntoCorrectArguments(mvls)
|
MySQL.applescript
|
if class of mvls is not list then
|
MySQL.applescript
|
repeat with itm in mvls
|
MySQL.applescript
|
if (class of itm) is integer or (class of itm) is real then
|
MySQL.applescript
|
set end of resultat to itm as text
|
MySQL.applescript
|
set end of resultat to "\"" & _mySQLSecurifyArgument(itm as text) & "\""
|
MySQL.applescript
|
set resultat2 to _mySQLJoinStringList(resultat, ",")
|
MySQL.applescript
|
return resultat2
|
MySQL.applescript
|
end _mySQLConvertIntoCorrectArguments
|
MySQL.applescript
|
on insert into table given connection:connection, database:dbName, columns:columnsAvailable, values:matchingValues
|
MySQL.applescript
|
set query to "INSERT INTO `" & dbName & "`.`" & table & "` (" & _mySQLJoinStringList(columnsAvailable, ",") & ") VALUES (" & _mySQLConvertIntoCorrectArguments(matchingValues) & ")"
|
MySQL.applescript
|
_mySQLCLIWrapper(host of connection, usern of connection, password of connection, query)
|
MySQL.applescript
|
on query given connection:connection, query:query
|
MySQL.applescript
|
return _mySQLCLIWrapper(host of connection, usern of connection, password of connection, query)
|
MySQL.applescript
|
end query
|
MySQL.applescript
|
set the URL of the document 1 to paragraph n of urls
|
Open URLs from clipboard md copy.scpt
|
set theUrl to i -- my extract_urls(i)
|
Open URLs from clipboard md copy.scpt
|
set theUrl to my extract_url(i)
|
Open URLs from clipboard md copy.scpt
|
if theUrl is not "" then -- remove blanks
|
Open URLs from clipboard md copy.scpt
|
set theUrls to theUrl & return & theUrls
|
Open URLs from clipboard md copy.scpt
|
log "4. " & (get theUrl)
|
Open URLs from clipboard md copy.scpt
|
set theUrl to ""
|
Open URLs from clipboard md copy.scpt
|
set theUrl to (get text item 2 of theMarkdownURL)
|
Open URLs from clipboard md copy.scpt
|
set theUrl to text 1 thru -2 of theUrl -- strip off the last ")"
|
Open URLs from clipboard md copy.scpt
|
return theUrl
|
Open URLs from clipboard md copy.scpt
|
set bbFind to find "(^|\\. )[A-Za-z0-9]" selecting match false ¬
|
bbedit_select_sentence.applescript
|
if bbFind's found is false then
|
bbedit_select_sentence.applescript
|
set theStart to (bbFind's found object's characterOffset) + ((bbFind's found object's length) - 1)
|
bbedit_select_sentence.applescript
|
set lastFind to find "\\. " selecting match false ¬
|
bbedit_select_sentence.applescript
|
if lastFind's found is false then
|
bbedit_select_sentence.applescript
|
set theEnd to length of it
|
bbedit_select_sentence.applescript
|
set theEnd to (lastFind's found object's characterOffset) + ((lastFind's found object's length) - 3)
|
bbedit_select_sentence.applescript
|
select (characters theStart thru (theEnd))
|
bbedit_select_sentence.applescript
|
mount volume "smb://DiskStation.local/Archive"
|
DiskStationMountSMB.applescript
|
mount volume "smb://DiskStation.local/Documents"
|
DiskStationMountSMB.applescript
|
mount volume "smb://DiskStation.local/Media"
|
DiskStationMountSMB.applescript
|
mount volume "smb://DiskStation.local/Pictures"
|
DiskStationMountSMB.applescript
|
property notesFolder : "/Users/you/Dropbox/Notes/" -- include leading and trailing slash
|
Edit%20Last%20Modified%20Note%20and%20Preview%20in%20Marked.scpt
|
property editorList : {"FoldingText", "Sublime Text 2", "nvALT", "Byword", "MultiMarkdown Composer", "Mou"}
|
Edit%20Last%20Modified%20Note%20and%20Preview%20in%20Marked.scpt
|
property alwaysMarked : false -- Don't prompt, *always* open Marked
|
Edit%20Last%20Modified%20Note%20and%20Preview%20in%20Marked.scpt
|
property openMarked : true -- Prompt to open a preview in Marked
|
Edit%20Last%20Modified%20Note%20and%20Preview%20in%20Marked.scpt
|
property markedDialogDefault : true -- Set to false for "no" button to be highlighted
|
Edit%20Last%20Modified%20Note%20and%20Preview%20in%20Marked.scpt
|
property alignWindows : true -- Set this to false to disable the window positioning at the end of the script
|
Edit%20Last%20Modified%20Note%20and%20Preview%20in%20Marked.scpt
|
property alignWindowsDefault : true -- Set this to false to position the preview on the left side
|
Edit%20Last%20Modified%20Note%20and%20Preview%20in%20Marked.scpt
|
property xNotes : 15 -- set how many recently modified notes should be displayed
|
Edit%20Last%20Modified%20Note%20and%20Preview%20in%20Marked.scpt
|
property searchNotes : "*.{md,txt}" -- specify what notes to display, c.f. *draft*.{md,txt,taskpaper,mmd}
|
Edit%20Last%20Modified%20Note%20and%20Preview%20in%20Marked.scpt
|
property nvPosition : false -- Set this to false if your nvALT is usually on the right side of the screen
|
Edit%20Last%20Modified%20Note%20and%20Preview%20in%20Marked.scpt
|
on cancelHandler(i)
|
Edit%20Last%20Modified%20Note%20and%20Preview%20in%20Marked.scpt
|
if i is false then
|
Edit%20Last%20Modified%20Note%20and%20Preview%20in%20Marked.scpt
|
end cancelHandler
|
Edit%20Last%20Modified%20Note%20and%20Preview%20in%20Marked.scpt
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.