text
stringlengths
0
15.7k
source
stringlengths
6
112
set collectionName to "Copyright - " & searchText
lns3.scpt
«event fbokfbad» (every «class fbfc» whose «class fbcr» contains searchText) given «class fbto»:«class fbcl» collectionName
lns3.scpt
if (every «class fbcl» whose every «class fbfc» is {}) is {} then
lns3.scpt
display dialog "There are no empty collections." buttons {"OK"} default button 1
lns3.scpt
set confirmResult to display dialog "Are you sure you want to delete empty collections?" & return & "You can not undo this action." with icon caution
lns3.scpt
if button returned of confirmResult is "好" then
lns3.scpt
delete (every «class fbcl» whose every «class fbfc» is {})
lns3.scpt
set styleName to "Italic"
lns3.scpt
set collectionName to "Italic"
lns3.scpt
set wasTextEditRunning to (name of processes) contains "TextEdit"
lns3.scpt
set selectedFamilies to «class fbff»
lns3.scpt
set selectedTypefaces to «class selc»
lns3.scpt
set numFamilies to count selectedFamilies
lns3.scpt
set numFaces to count selectedTypefaces
lns3.scpt
if wasTextEditRunning then
lns3.scpt
make new document at the end of documents of it
lns3.scpt
set paragraph 1 to "Font Samples - " & ¬
lns3.scpt
numFamilies & " families " & ¬
lns3.scpt
numFaces & " typefaces" & return & return & return
lns3.scpt
set size to 18
lns3.scpt
set paraIndex to 3
lns3.scpt
repeat while selectedTypefaces is not {}
lns3.scpt
set thisFace to first item of selectedTypefaces
lns3.scpt
set familyName to «class fbfn» of thisFace
lns3.scpt
set selectedTypefaces to the rest of selectedTypefaces
lns3.scpt
set postScriptNames to {«class fbps» of thisFace}
lns3.scpt
set anotherFace to first item of selectedTypefaces
lns3.scpt
if «class fbfn» of anotherFace is familyName then
lns3.scpt
set the end of postScriptNames to «class fbps» of anotherFace
lns3.scpt
tell the front document of application "TextEdit"
lns3.scpt
tell paragraph paraIndex
lns3.scpt
set font to "LucidaGrande"
lns3.scpt
set size to 14
lns3.scpt
set characters to familyName & return & return
lns3.scpt
set paraIndex to paraIndex + 1
lns3.scpt
repeat with psName in postScriptNames
lns3.scpt
set font to psName
lns3.scpt
set characters to tab & psName & return & return
lns3.scpt
if success then
lns3.scpt
set paragraph paraIndex to return & return
lns3.scpt
tell application "TextEdit" to activate
lns3.scpt
set lf to (ASCII character 10)
lns3.scpt
set savedListSpec to choose file with prompt "Open the file containing the list of deactivated fonts"
lns3.scpt
set savedList to open for access savedListSpec
lns3.scpt
set typefaceToReactivate to (read savedList before lf)
lns3.scpt
if (offset of "*" in typefaceToReactivate) is 0 then
lns3.scpt
set «class fben» of «class fbfc» typefaceToReactivate to true
lns3.scpt
display dialog "Could not reactivate \"" & typefaceToReactivate & "\"" buttons {"OK"} default button 1
lns3.scpt
display dialog "Finished reactivating non-Apple fonts." buttons {"OK"} default button 1
lns3.scpt
tell application "Finder" to set FinderSelection to the selection as alias list
lns3.scpt
set FS to FinderSelection
lns3.scpt
set SelectionCount to number of FS -- count
lns3.scpt
if SelectionCount is 0 then
lns3.scpt
set FS to userPicksFolder()
lns3.scpt
else if the SelectionCount is 1 then
lns3.scpt
set MyPath to path to me
lns3.scpt
if MyPath is item 1 of FS then
lns3.scpt
open FS
lns3.scpt
on userPicksFolder()
lns3.scpt
set these_items to {}
lns3.scpt
set these_items to (choose folder with prompt "Select a folder whose contents you wish to print:") as list
lns3.scpt
end userPicksFolder
lns3.scpt
property pShortPath : ""
lns3.scpt
on open these_items
lns3.scpt
set the item_info to {}
lns3.scpt
repeat with i from 1 to the count of these_items
lns3.scpt
set this_item to (item i of these_items)
lns3.scpt
set the item_info to info for this_item
lns3.scpt
if folder of the item_info is true then --if the item is a folder
lns3.scpt
set pShortPath to (item i of these_items as string)
lns3.scpt
set thePOSIXFilePath to POSIX path of pShortPath as string
lns3.scpt
processFolder(thePOSIXFilePath)
lns3.scpt
on processFolder(theFolder)
lns3.scpt
set OldDelims to AppleScript's text item delimiters
lns3.scpt
set newTextList to text items of theFolder
lns3.scpt
set x to the count of newTextList
lns3.scpt
set printedPath to items 1 thru (x - 1) of newTextList as string
lns3.scpt
set AppleScript's text item delimiters to OldDelims
lns3.scpt
set theShellScript to ("( echo " & printedPath & " && ls -l \"" & theFolder & "\" ) | lpr " as string)
lns3.scpt
do shell script theShellScript
lns3.scpt
on error ErrMsg number ErrNmbr
lns3.scpt
display dialog ErrMsg & "
lns3.scpt
Error: " & ErrNmbr buttons {"OK"} with icon note
lns3.scpt
end processFolder
lns3.scpt
set theShellScript to ("( echo " & printedPath & " && ls -R \"" & printedPath & "\" ) | lpr " as string)
lns3.scpt
property type_list : {"JPEG", "GIFf", "PICT", "TIFF", "PDF", "TEXT"}
lns3.scpt
property extension_list : {"jpg", "gif", "pct", "tif", "pdf", "rtf"}
lns3.scpt
set these_items to (choose file with prompt "Select a file to convert to PostScript:" of type {"JPEG", "GIFf", "PICT", "TIFF", "TEXT", "RTF"}) as list
lns3.scpt
set thesefiles to {}
lns3.scpt
processFolder(this_item)
lns3.scpt
else if ((folder of the item_info is false) and ¬
lns3.scpt
(alias of the item_info is false)) and ¬
lns3.scpt
(the file type of the item_info is in the type_list) or ¬
lns3.scpt
((the name extension of the item_info) is in the extension_list) then
lns3.scpt
set theFilePath to (item i of these_items as string)
lns3.scpt
set thePOSIXFilePath to POSIX path of theFilePath as string
lns3.scpt
processFile(thePOSIXFilePath)
lns3.scpt
set these_items to list folder theFolder without invisibles
lns3.scpt
set this_item to alias ((theFolder as text) & (item i of these_items))
lns3.scpt
if folder of the item_info is true then
lns3.scpt