text
stringlengths
0
15.7k
source
stringlengths
6
112
set firstFile to (item 1 in input) as string
open-file-in-vim.applescript
tell application "Finder" to set pathFolderParent to quoted form of (POSIX path of ((folder of item firstFile) as string))
open-file-in-vim.applescript
set end of command to "cd "
open-file-in-vim.applescript
set end of command to (pathFolderParent as string)
open-file-in-vim.applescript
set end of command to ";vim"
open-file-in-vim.applescript
if firstFile ends with ".vim" then
open-file-in-vim.applescript
set end of command to " -S "
open-file-in-vim.applescript
set end of command to " -p "
open-file-in-vim.applescript
repeat with i from 1 to count input
open-file-in-vim.applescript
set end of fileList to quoted form of (POSIX path of (item i of input as string)) & space
open-file-in-vim.applescript
set end of command to (fileList as string)
open-file-in-vim.applescript
set (calculates folder sizes of list view options of front Finder window) to (not calculates folder sizes of list view options of front Finder window)
Calculate all sizes.applescript
use framework "WebKit"
WebLib.scpt
property NSURLComponents : class "NSURLComponents"
WebLib.scpt
property NSMutableString : class "NSMutableString"
WebLib.scpt
property NSRegularExpression : class "NSRegularExpression"
WebLib.scpt
property NSSet : class "NSSet"
WebLib.scpt
property monthNames : {January, February, March, April, May, June, July, August, September, October, November, December}
WebLib.scpt
property PNG : "PNG"
WebLib.scpt
property JPG : "JPG"
WebLib.scpt
property HTML : "HTML"
WebLib.scpt
property TXT : "TXT"
WebLib.scpt
property PDF : "PDF"
WebLib.scpt
script WiFiManager
WebLib.scpt
set interface to current application's CWWiFiClient's sharedWiFiClient()'s interface()
WebLib.scpt
interface's disassociate()
WebLib.scpt
on disable()
WebLib.scpt
my (interface's setPower:false |error|:(missing value))
WebLib.scpt
end disable
WebLib.scpt
on enable()
WebLib.scpt
my (interface's setPower:true |error|:(missing value))
WebLib.scpt
end enable
WebLib.scpt
return current application's CWWiFiClient's sharedWiFiClient()'s interface()'s hardwareAddress() as text
WebLib.scpt
return current application's CWWiFiClient's sharedWiFiClient()'s interface()'s rssiValue()
WebLib.scpt
return current application's CWWiFiClient's sharedWiFiClient()'s interface()'s ssid() as text
WebLib.scpt
on connectToNetwork:networkName usingPassword:thePassword
WebLib.scpt
set theWiFiInterface to current application's CWWiFiClient's sharedWiFiClient()'s interface()
WebLib.scpt
log "hi"
WebLib.scpt
(theWiFiInterface's associateToNetwork:theNetwork |password|:thePassword |error|:(missing value))
WebLib.scpt
end connectToNetwork:usingPassword:
WebLib.scpt
on WLWebsite()
WebLib.scpt
script Website
WebLib.scpt
property «class dscr» : missing value
WebLib.scpt
property URLString : missing value
WebLib.scpt
property HTML : missing value
WebLib.scpt
property visibleText : missing value
WebLib.scpt
property favicon : missing value
WebLib.scpt
property host : missing value
WebLib.scpt
property scheme : missing value
WebLib.scpt
property pathString : missing value
WebLib.scpt
property query : missing value
WebLib.scpt
property queryItems : missing value
WebLib.scpt
property port : missing value
WebLib.scpt
on ping over numAttempts : 1
WebLib.scpt
set hostname to my host
WebLib.scpt
set pingCommand to "/sbin/ping -c " & numAttempts & " " & quoted form of hostname & " | tail -1| awk '{print $4}' | cut -d '/' -f 2"
WebLib.scpt
set pingOutput to do shell script pingCommand
WebLib.scpt
return pingOutput as number
WebLib.scpt
end ping
WebLib.scpt
on save in filePath as filetype : "txt"
WebLib.scpt
set _NSURL to current application's NSClassFromString("NSURL")
WebLib.scpt
set theURL to NSURL's URLWithString:(my URLString)
WebLib.scpt
set theData to current application's NSData's dataWithContentsOfURL:theURL
WebLib.scpt
if filetype is TXT or filetype is HTML then
WebLib.scpt
set homedir to current user's home directory as text
WebLib.scpt
set theFile to open for access filePath with write permission
WebLib.scpt
write my HTML to theFile
WebLib.scpt
else if filetype is PDF then
WebLib.scpt
do shell script "/usr/local/bin/wkhtmltopdf \"" & (my URLString) & "\" \"" & filePath & "\"" user name "steven"
WebLib.scpt
log err
WebLib.scpt
display alert "Install wkhtmltopdf from wkhtmltopdf.org."
WebLib.scpt
else if filetype is PNG then
WebLib.scpt
do shell script "/usr/local/bin/wkhtmltoimage --format \"PNG\" \"" & (my URLString) & "\" \"" & filePath & "\"" user name "steven"
WebLib.scpt
display alert "Install wkhtmltoimage from wkhtmltopdf.org."
WebLib.scpt
else if filetype is JPG then
WebLib.scpt
do shell script "/usr/local/bin/wkhtmltoimage --format \"JPG\" \"" & (my URLString) & "\" \"" & filePath & "\"" user name "steven"
WebLib.scpt
open location URLString
WebLib.scpt
end WLWebsite
WebLib.scpt
on ping for site over numAttempts : 1
WebLib.scpt
if class of site is script then
WebLib.scpt
return site's (ping over numAttempts)
WebLib.scpt
else if class of site is text then
WebLib.scpt
set theURL to NSURL's URLWithString:site
WebLib.scpt
set hostname to theURL's |host|() as text
WebLib.scpt
on websiteWithURLString:URLString
WebLib.scpt
set newWebsite to WLWebsite()
WebLib.scpt
set newWebsite's URLString to URLString
WebLib.scpt
set theURL to NSURL's URLWithString:URLString
WebLib.scpt
set newWebsite's host to (theURL's |host|()) as text
WebLib.scpt
set newWebsite's scheme to (theURL's |scheme|()) as text
WebLib.scpt
set newWebsite's pathString to (theURL's |path|()) as text
WebLib.scpt
set newWebsite's query to (theURL's query()) as text
WebLib.scpt
set newWebsite's port to (theURL's |port|()) as text
WebLib.scpt
set faviconURL to NSURL's URLWithString:("http://" & newWebsite's host & "/favicon.ico")
WebLib.scpt
set faviconImg to NSImage's alloc()'s initWithContentsOfURL:faviconURL
WebLib.scpt
set newWebsite's favicon to faviconImg
WebLib.scpt
set URLComponents to NSURLComponents's componentsWithString:URLString
WebLib.scpt
set theQueryItems to {} as record
WebLib.scpt
if URLComponents's queryItems() is not missing value then
WebLib.scpt
repeat with theComponent in URLComponents's queryItems()
WebLib.scpt