text
stringlengths
0
15.7k
source
stringlengths
6
112
set question to display dialog "Width of paper block" default answer (6) buttons {"Avbryt", "OK"} default button "OK"
make_hardcover.applescript
set rygg to text returned of question
make_hardcover.applescript
set totalhoyde to hoyde + 30 + 4 + 6
make_hardcover.applescript
set totalbredde to bredde + bredde + 14 + 4 + 30 + rygg
make_hardcover.applescript
set rygg to rygg as real
make_hardcover.applescript
tell default document 1
make_hardcover.applescript
set column count to 1
make_hardcover.applescript
set automatic text box to false
make_hardcover.applescript
set bottom margin to "17mm"
make_hardcover.applescript
set facing pages to false
make_hardcover.applescript
set top margin to "17mm"
make_hardcover.applescript
set left margin to "17mm"
make_hardcover.applescript
set right margin to "17mm"
make_hardcover.applescript
set page width to totalbredde
make_hardcover.applescript
set page height to totalhoyde
make_hardcover.applescript
make document at beginning
make_hardcover.applescript
tell page 1 of document 1
make_hardcover.applescript
set a to (totalbredde - rygg) / 2
make_hardcover.applescript
make vertical guide at beginning with properties {position:a}
make_hardcover.applescript
set b to a - 2
make_hardcover.applescript
make vertical guide at beginning with properties {position:b}
make_hardcover.applescript
set b to b - 7
make_hardcover.applescript
set b to b - 2
make_hardcover.applescript
set a to a + rygg
make_hardcover.applescript
set b to a + 2
make_hardcover.applescript
set b to b + 7
make_hardcover.applescript
set b to b + 2
make_hardcover.applescript
 set html to "<html>" & return & "<head>" & return
Script 14-5.applescript
set html to html & "<title>Multiplication Table</title>" & return
Script 14-5.applescript
set html to html & "</head>" & return & "<body>" & return
Script 14-5.applescript
set html to html & "<table border=1 cellpadding=2>" & return
Script 14-5.applescript
repeat with i from 1 to 10
Script 14-5.applescript
set html to html & "<tr>" & return
Script 14-5.applescript
repeat with j from 1 to 10
Script 14-5.applescript
set html to html & "<td>" & (i * j) & "</td>"
Script 14-5.applescript
set html to html & "</tr>" & return
Script 14-5.applescript
set html to html & "</table>" & return & "</body>" & return & "</html>"
Script 14-5.applescript
set userPrefix to "y"
Yamaha 300 Generator.applescript
set userNamePrefix to "Yamaha Scene"
Yamaha 300 Generator.applescript
set showMIDIInfo to true
Yamaha 300 Generator.applescript
set scene to 1
Yamaha 300 Generator.applescript
repeat 300 times
Yamaha 300 Generator.applescript
make type "MIDI"
Yamaha 300 Generator.applescript
set q number of newCue to userPrefix & scene
Yamaha 300 Generator.applescript
set command of newCue to program_change
Yamaha 300 Generator.applescript
if i is less than 128 then
Yamaha 300 Generator.applescript
set theChannel to 1
Yamaha 300 Generator.applescript
set byteOne to i
Yamaha 300 Generator.applescript
else if i is less than 256 then
Yamaha 300 Generator.applescript
set theChannel to 2
Yamaha 300 Generator.applescript
set byteOne to (i - 128)
Yamaha 300 Generator.applescript
set theChannel to 3
Yamaha 300 Generator.applescript
set byteOne to (i - 256)
Yamaha 300 Generator.applescript
set channel of newCue to theChannel
Yamaha 300 Generator.applescript
set byte one of newCue to byteOne
Yamaha 300 Generator.applescript
if showMIDIInfo then
Yamaha 300 Generator.applescript
set q name of newCue to userNamePrefix & " " & scene & " (Ch " & theChannel & " / PC " & byteOne & ")"
Yamaha 300 Generator.applescript
set q name of newCue to userNamePrefix & scene
Yamaha 300 Generator.applescript
set scene to scene + 1
Yamaha 300 Generator.applescript
global exiftool
Strip PDF metadata.applescript
on open fileList
Strip PDF metadata.applescript
set tempdir to (do shell script "echo $TMPDIR")
Strip PDF metadata.applescript
set exiftool to "/opt/homebrew/bin/exiftool -q -q "
Strip PDF metadata.applescript
set logData to ""
Strip PDF metadata.applescript
set pythonPath to (POSIX path of (path to documents folder as string)) & "github/local/scripts/"
Strip PDF metadata.applescript
set dateString to (do shell script " date +%Y-%m-%d_%H.%M.%S")
Strip PDF metadata.applescript
set logfile to (path to documents folder) & "PDF_metadata_" & dateString & ".txt" as string
Strip PDF metadata.applescript
set processedCount to 0
Strip PDF metadata.applescript
set itemCount to (count of items of fileList)
Strip PDF metadata.applescript
repeat with filename in fileList
Strip PDF metadata.applescript
set fname to name of filename
Strip PDF metadata.applescript
set ext to (name extension of file filename) as string
Strip PDF metadata.applescript
set ext to (do shell script "echo " & ext & " | tr '[:upper:]' '[:lower:]'")
Strip PDF metadata.applescript
if ext is not "pdf" then
Strip PDF metadata.applescript
set logData to logData & ((filename) as string) & ": does not appear to be a PDF file. Skipping." & return
Strip PDF metadata.applescript
set keepdataSwitch to ""
Strip PDF metadata.applescript
set pfile to the quoted form of the POSIX path of filename
Strip PDF metadata.applescript
set pname to the quoted form of (do shell script "basename " & pfile)
Strip PDF metadata.applescript
set checkLog to my checkPDF(pfile)
Strip PDF metadata.applescript
if checkLog is "" then
Strip PDF metadata.applescript
set metadata to (do shell script exiftool & " -title -author " & pfile)
Strip PDF metadata.applescript
if metadata is not "" then
Strip PDF metadata.applescript
set metadata to (do shell script "echo " & quoted form of metadata & " | perl -pe 's/\\s+:\\s/: /g'")
Strip PDF metadata.applescript
set metadata to return & return & metadata
Strip PDF metadata.applescript
set reply to (display dialog pname & return & return & "Do you want to keep this title and author metadata?" & metadata with title "Keep metadata?" buttons {"Cancel", "No", "Yes"} default button 3)
Strip PDF metadata.applescript
if button returned of reply = "Yes" then set keepdataSwitch to " -k "
Strip PDF metadata.applescript
do shell script pythonPath & "pdf_remove_metadata.py " & keepdataSwitch & pfile & " " & tempdir & pname
Strip PDF metadata.applescript
display alert "Problem with python script" message errNum & ": " & errMsg
Strip PDF metadata.applescript
tell application "Finder" to delete file filename
Strip PDF metadata.applescript
do shell script "mv " & tempdir & pname & " " & pfile
Strip PDF metadata.applescript
if itemCount > 1 then
Strip PDF metadata.applescript
set logData to logData & ((filename) as string) & ": deleted the metadata." & return
Strip PDF metadata.applescript
set processedCount to processedCount + 1
Strip PDF metadata.applescript
set logData to logData & ((filename) as string) & ": " & checkLog & " Skipping." & return
Strip PDF metadata.applescript
if logData is not "" then
Strip PDF metadata.applescript
set theOpenedFile to open for access file logfile with write permission
Strip PDF metadata.applescript
write logData to theOpenedFile
Strip PDF metadata.applescript
close access theOpenedFile
Strip PDF metadata.applescript
if processedCount = 1 then
Strip PDF metadata.applescript
display notification ("Finished deleting the metadata from your file.") with title "Metadata removed" sound name "beep"
Strip PDF metadata.applescript