property WaitingForLoginWindowFile : "/usr/libexec/WaitingForLoginWindow" property OutWFLW : "/Users/willb/Slush/Customise/Boot Panels/WaitingForLoginWindow/autoWFLW" property KnownWaitingForLoginWindowSize : 70384 property KnownBootPanelMaxSize : 12517 display dialog "Drop a PDF on me" on open (x) set x to item 1 of x set WaitingForLoginWindow to info for POSIX file WaitingForLoginWindowFile set WaitingForLoginWindowSize to size of WaitingForLoginWindow if (WaitingForLoginWindowSize is not equal to KnownWaitingForLoginWindowSize) then display dialog "Incorrectly Sized WaitingForLoginWindow file" buttons "Quit" default button 1 return end if set BootPanel to info for x set BootPanelSize to size of BootPanel if (BootPanelSize > KnownBootPanelMaxSize) then display dialog "BootPanel too large, reduce it" buttons "Quit" default button 1 return end if set WFLW to open for access POSIX file WaitingForLoginWindowFile set OutFile to open for access POSIX file OutWFLW with write permission set InBoot to open for access x if ((read InBoot for 4) is not equal to "%PDF") then display dialog "BootPanel input is not PDF" buttons "Quit" default button 1 close access WFLW close access OutFile close access InBoot tell application "Finder" to delete POSIX file OutWFLW display dialog "Not a PDF input file" return end if write (read WFLW for 36864) to OutFile write "%PDF" to OutFile write (read InBoot for BootPanelSize - 10) to OutFile repeat KnownBootPanelMaxSize - BootPanelSize times write " " to OutFile end repeat write (read InBoot) to OutFile write (read WFLW from 49382) to OutFile close access WFLW close access OutFile close access InBoot display dialog "Success" buttons "Great" default button 1 giving up after 5 end open