text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
print e1,'\\t',e2,'\\t',e3,'\\t',e4,'\\t',e5,'\\t',e6,'\\t',e7
|
applist.applescript
|
cmd = ['system_profiler', '-xml', 'SPSoftwareDataType']
|
applist.applescript
|
try: e1 = e['local_host_name'].encode('sjis')
|
applist.applescript
|
try: e2 = e['os_version'].encode('sjis')
|
applist.applescript
|
try: e3 = e['user_name'].encode('sjis')
|
applist.applescript
|
print e1,'\\t',e2,'\\t',e3
|
applist.applescript
|
cmd = ['system_profiler', '-xml', 'SPApplicationsDataType']
|
applist.applescript
|
try: e1 = e['_name'].encode('sjis')
|
applist.applescript
|
try: e2 = e['version'].encode('sjis')
|
applist.applescript
|
try: e3 = e['obtained_from'].encode('sjis')
|
applist.applescript
|
try: e4 = e['lastModified']
|
applist.applescript
|
try: e5 = e['runtime_environment'].encode('sjis')
|
applist.applescript
|
try: e6 = e['path'].encode('sjis')
|
applist.applescript
|
print e1,'\\t',e2,'\\t',e3,'\\t',e4,'\\t',e5,'\\t',e6
|
applist.applescript
|
do shell script "python -c " & code & " 2>/dev/null > " & pos_path
|
applist.applescript
|
end parse_spx
|
applist.applescript
|
tell application "QuarkXPress"
|
QuarkXPressObjectHierarchy.applescript
|
tell page 2
|
QuarkXPressObjectHierarchy.applescript
|
tell text box 1
|
QuarkXPressObjectHierarchy.applescript
|
set word 5 to "Apple"
|
QuarkXPressObjectHierarchy.applescript
|
on open fname
|
Get all PDF images.applescript
|
set ext to (name extension of file fname) as string
|
Get all PDF images.applescript
|
display alert "Wrong file type" message "This does not appear to be a PDF file. Quitting."
|
Get all PDF images.applescript
|
set filetypes to " -png -tiff -j -jp2 -ccitt "
|
Get all PDF images.applescript
|
set imagePath to "/opt/homebrew/bin/pdfimages"
|
Get all PDF images.applescript
|
set infoPath to "/opt/homebrew/bin/pdfinfo"
|
Get all PDF images.applescript
|
set binaryCheck to (do shell script infoPath & " -v")
|
Get all PDF images.applescript
|
set pfile to the POSIX path of fname
|
Get all PDF images.applescript
|
set fpath to (do shell script "dirname " & quoted form of pfile) & "/"
|
Get all PDF images.applescript
|
set fnameString to characters 1 thru 15 of (((name of file fname) as string) & " ") as string
|
Get all PDF images.applescript
|
set fnameString to (do shell script "echo " & quoted form of fnameString & " | tr ' ' '_'")
|
Get all PDF images.applescript
|
set imageCount to ((do shell script (imagePath & " -list " & quoted form of pfile & " | wc -l")) as integer) - 2
|
Get all PDF images.applescript
|
if imageCount = 0 then
|
Get all PDF images.applescript
|
display alert "No images!" message "Oops. This file has no images in it."
|
Get all PDF images.applescript
|
set fpath to (do shell script "dirname " & quoted form of pfile) & "/" & dateString & "_" & fnameString & "_images/"
|
Get all PDF images.applescript
|
if imageCount > 100 then
|
Get all PDF images.applescript
|
set reply to (display dialog "This file has " & imageCount & " images in it. Do you want to continue?" with title "Lots of images!" buttons {"Yes", "No"} default button 1 cancel button 2)
|
Get all PDF images.applescript
|
set pageCount to (do shell script infoPath & " " & quoted form of pfile & " | grep Pages | sed 's/Pages://'") as number
|
Get all PDF images.applescript
|
do shell script ("mkdir " & quoted form of fpath)
|
Get all PDF images.applescript
|
repeat with i from 1 to pageCount
|
Get all PDF images.applescript
|
set outputname to (i as string)
|
Get all PDF images.applescript
|
repeat until the number of characters in outputname = 4
|
Get all PDF images.applescript
|
set outputname to "0" & outputname
|
Get all PDF images.applescript
|
do shell script (imagePath & filetypes & " -f " & i & " -l " & i & " -p " & quoted form of pfile & " " & quoted form of (fpath & outputname))
|
Get all PDF images.applescript
|
display notification ("Finished extracting " & imageCount & " images from your file.") with title "Image extraction" sound name "beep"
|
Get all PDF images.applescript
|
set appname to the name of (process 1 where frontmost is true)
|
Restart.applescript
|
tell application appname to quit
|
Restart.applescript
|
set listOfProcesses to {}
|
Restart.applescript
|
repeat until listOfProcesses does not contain appname
|
Restart.applescript
|
set logLines to do shell script "tail -n3 /var/log/system.log"
|
36_02_shell_commands_example_Tail-log-file.applescript
|
display dialog logLines
|
36_02_shell_commands_example_Tail-log-file.applescript
|
property DEF_APP_NAME : "HyperSwitch"
|
restartApp.applescript
|
property DEF_DIR : "/Applications"
|
restartApp.applescript
|
on restartApp(pars)
|
restartApp.applescript
|
set {appName, dir} to {DEF_APP_NAME, DEF_DIR}
|
restartApp.applescript
|
set appName to appName of pars
|
restartApp.applescript
|
set dir to dir of pars
|
restartApp.applescript
|
repeat while application appName is running
|
restartApp.applescript
|
tell application (dir & "/" & appName & ".app")
|
restartApp.applescript
|
end restartApp
|
restartApp.applescript
|
restartApp({})
|
restartApp.applescript
|
set the_track_name to name of current track
|
Script 5-3.applescript
|
set the_album to album of current track
|
Script 5-3.applescript
|
set the_artist to artist of current track
|
Script 5-3.applescript
|
tell application "System Events" to set windowSize to size of front window of (first application process whose frontmost is true)
|
1β - π¨ β¦ Center.scpt
|
set windowWidth to item 1 of windowSize
|
1β - π¨ β¦ Center.scpt
|
set windowHeight to item 2 of windowSize
|
1β - π¨ β¦ Center.scpt
|
set finalPositionX to (screenWidth - windowWidth) / 2
|
1β - π¨ β¦ Center.scpt
|
set finalPositionY to (screenHeight - windowHeight) / 2 - dockHeight
|
1β - π¨ β¦ Center.scpt
|
set finalSizeX to windowWidth
|
1β - π¨ β¦ Center.scpt
|
set finalSizeY to windowHeight
|
1β - π¨ β¦ Center.scpt
|
ο»Ώon do_math(a, b, the_operator)
|
Script 18-3.applescript
|
if the_operator is "+" then
|
Script 18-3.applescript
|
else if the_operator is "-" then
|
Script 18-3.applescript
|
return a - b
|
Script 18-3.applescript
|
else if the_operator is "*" then
|
Script 18-3.applescript
|
return a * b
|
Script 18-3.applescript
|
error "Unknown operation."
|
Script 18-3.applescript
|
end do_math
|
Script 18-3.applescript
|
set the_notes to selection
|
batch_rename.applescript
|
set the_dialog to display dialog "What would you like to title these notes?" default answer ""
|
batch_rename.applescript
|
set the_title to text returned of the_dialog
|
batch_rename.applescript
|
set the_count to 1
|
batch_rename.applescript
|
repeat with n in the_notes
|
batch_rename.applescript
|
set title of n to the_title & " " & the_count
|
batch_rename.applescript
|
set the_count to the_count + 1
|
batch_rename.applescript
|
on run eventArgs
|
power_events.applescript
|
set thisTrigger to (trigger of eventArgs)
|
power_events.applescript
|
set diskName to "WD2T"
|
power_events.applescript
|
set diskStatus to "Unknown"
|
power_events.applescript
|
if thisTrigger is "Power switched to battery" then
|
power_events.applescript
|
set tmStatus to do shell script " tmutil status | grep -c \"Running = 1\""
|
power_events.applescript
|
if tmStatus is "1" then
|
power_events.applescript
|
display dialog "A backup IS running. Don't disconnect your disk yet!"
|
power_events.applescript
|
on error number 1
|
power_events.applescript
|
set my diskStatus to "Mounted"
|
power_events.applescript
|
if (diskStatus is "Mounted") then
|
power_events.applescript
|
set myVariable to (display dialog "No backup running. Eject WD2T?")
|
power_events.applescript
|
set theButtonName to the button returned of myVariable
|
power_events.applescript
|
if (theButtonName is "OK") then
|
power_events.applescript
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.