home *** CD-ROM | disk | FTP | other *** search
Wrap
-- colorizeHC "add", "HD:Desktop Folder:PICT:Browse Resources", "90,134,254,172", , "copy with dithering" -- ,HD:Desktop Folder:PICT:Browse Resources, <-- This (item 2 of line 2) is the full path name of my current picture -- HD:Desktop Folder:PICT: <-- This is the path to pictures -- Browse Resources <-- This (word 2 of line 4) is the name of the PICT file that I will open on mouseUp if the short name of me is "Scaling Path" then newfile put "Click on the button again to make it scale" exit mouseup end if global Tools if the shiftkey is down and the optionkey is down then changeAttributes exit mouseup end if if the shiftkey is down and the commandkey is down then checkTools if Tools is not "Nope" then newClipPict exit mouseup else exit mouseup end if if the optionKey is down then locateme readytoScript exit mouseup end if if the commandKey is down then newFile exit mouseup end if if the shiftKey is down then deleteLastColor colorizeHC "Erase", rect of me set the showName of me to true go to this cd exit mouseup end if togglePicture end mouseup on newClipPict global myPicture get FullSFPack (P,,,"Name your new PICT file:", "Untitled") if it is empty then exit newClipPict put it into holdPictName put holdPictName into myPicture answer "Create thumbnail custom icon for your new PICT file?"¬ with "No" or "Yes" if it is "Yes" then ClipToPICT holdPictName if the result ≠ empty then answer the Result exit newClipPict end if CreateCustomIcon holdPictName if the result ≠ empty then answer the Result dothePicture exit newClipPict end if ClipToPICT holdPictName if the result ≠ empty then answer the Result exit newClipPict end if dothePicture end newClipPict on togglePicture locateme if the showName of me is true then put line 1 of the script of me into colorCommand delete word 1 of colorCommand do colorCommand set the showName of me to false go to this cd else set the lockscreen to true colorizeHC "Erase", rect of me set the showName of me to true go to this cd end if end togglePicture on locateMe put "-- " && "colorizeHC" && quote & "add" & quote & "," && quote &¬ item 2 of line 2 of the script of me & quote & "," ¬ && quote & the rect of me & quote & "," && "," && quote & "copy with dithering" & quote into line 1 of insertLine put the script of me into holdScript put line 1 of insertLine into line 1 of holdScript set the script of me to holdScript end locateMe on newFile global myPicture answer file "Choose your picture:" of type PICT if it is empty then exit newFile put it into myPicture dothePicture end newFile on dothePicture global myPicture -- put "Look inside the button script for the path you just set" into message colorizeHC "Erase", rect of me go to this cd colorizeHC "Add", myPicture , TopLeft of me, rect of me set the showName of me to false go to this cd put the script of me into holdScript put "-- " && "colorizeHC" && quote & "Add" & quote & "," && quote & myPicture & quote & ¬ "," && quote & TopLeft of me & quote & "," && quote & rect of me & quote into holdLine put holdLine into line 1 of holdScript put "-- " && "," & myPicture & "," && " <-- This (item 2 of line 2) is the full path name of my current picture" into line 2 of holdScript put myPicture into process get the last char of process if it is ":" then exit dothePicture answer "Try later with a better picture name." with "I know" end if if it is not ":" then put it into holdPictName delete last char of process repeat until it is ":" get the last char of process if it is not ":" then put it before char 1 of holdPictName delete the last char of process end repeat end if put "-- " && process & ":" && "<-- This is the path to pictures" into line 3 of holdScript put "-- " && holdPictName && "<-- This (word 2 of line 4) is the name of the PICT file that I will open" into line 4 of holdScript set the script of me to holdScript put word 2 of line 4 of the script of me && the id of me into newName set the name of me to newName go to this cd end dothePicture on checkTools global Tools get the short name of this stack if it is "ResGenie™" then put "Yep" into Tools exit checkTools end if do get offset ("ResGenie™", the stacksinuse) if it is not "0" then put "Yes" into tools exit checktools end if if it is "0" then answer "You need to use" && quote & "ResGenie™" & quote &¬ "for this feature to work." with "Cancel" or "Use" if it is "Use" then start using stack "ResGenie™" put "Yes" into Tools else if it is "Cancel" then put "Nope" into Tools end if end if end if end checkTools on newbutton put word 2 of line 4 of the script of me && the id of me into newName set the name of me to newName end newbutton on deletebutton colorizeHC "erase", the rect of me end deletebutton on readytoScript set cursor to watch put "Now checking all scripts..." global holdScript global colorauthoringpath get offset ("makeitcolor", the script of this stack) if it is "0" then do restext ("TEXT", "colorscriptsmoothe", colorauthoringpath) get offset ("on makeitcolor", the script of this bg) if it is "0" then do restext ("TEXT", "colorscriptsmoothe", colorauthoringpath) get offset ("on makeitcolor", the script of this cd) if it is "0" then do restext ("TEXT", "colorscriptsmoothe", colorauthoringpath) set the showname of me to true togglepicture put line 1 of the script of me into line 1 of insertLine delete word 1 of insertLine put the name of me into check if word 1 of check is "bkgnd" then put the script of this bg into holdScript put "bg" into wheretoGo put "send makeitcolor to this cd" into whattoSee put the name of this bg into myName end if if word 1 of check is "card" then put the script of this cd into holdScript put "cd" into wheretoGo put "end makeitcolor" into whattoSee put the name of this cd into myName end if get offset (insertLine, holdScript) if it is not "0" then answer "This picture has already been added here. Do you want to convert this to an ordinary button now?"¬ with "Yes" or "No" if it is "Yes" then do showdialog 3, "510", , ,short name of me , "7",, if the result is empty then exit readytoscript put the result into hold if line 1 of hold is "6" then set the style of me to "Transparent" if line 1 of hold is "5" then put word 1 to 2 of the name of me && "id" && the id of me into hold select hold domenu "Clear Button" choose browse tool set lockscreen to true opencard exit readytoscript end if set the name of me to line 2 of hold put "on mouseup" into line 1 of temp put " " into line 2 of temp put "end mouseup" into line 3 of temp set the script of me to temp end if exit readytoscript if it is "No" then exit readytoscript end if put quote & rect of me & quote into checkRegion get offset (checkRegion, holdScript) if it is "0" then do put offset (whattoSee, holdscript) into whereGo put insertLine & return before char whereGo of holdScript -- this should add the new colors do set the script of myName to holdScript do put "This picture has been added to" && the name of wheretoGo into message answer "Do you want to convert this to an ordinary button now?"¬ with "Yes" or "No" if it is "Yes" then do showdialog 3, "510", , ,short name of me , "7",, if the result is empty then exit readytoscript put the result into hold if line 1 of hold is "6" then set the style of me to "Transparent" if line 1 of hold is "5" then put word 1 to 2 of the name of me && "id" && the id of me into hold select hold domenu "Clear Button" choose browse tool set lockscreen to true opencard exit readytoscript end if set the name of me to line 2 of hold put "on mouseup" into line 1 of temp put " " into line 2 of temp put "end mouseup" into line 3 of temp set the script of me to temp end if exit readytoscript end if if it is not "0" then answer "You are painting in an area already painted. This is not necessarily a problem, but painting the same region twice will take longer." ¬ with "Cancel" or "Continue" end if if it is "Cancel" then exit readytoScript if it is "Continue" then do put offset (whattoSee, holdscript) into whereGo put insertLine & return before char whereGo of holdScript -- this should add the new colors do set the script of myName to holdScript do put "This overlapping color has been added to" && the name of wheretoGo into message answer "Do you want to convert this to an ordinary button now?"¬ with "Yes" or "No" if it is "Yes" then do showdialog 3, "510", , ,short name of me , "7",, if the result is empty then exit readytoscript put the result into hold if line 1 of hold is "6" then set the style of me to "Transparent" if line 1 of hold is "5" then put word 1 to 2 of the name of me && "id" && the id of me into hold select hold domenu "Clear Button" choose browse tool set lockscreen to true opencard exit readytoscript end if set the name of me to line 2 of hold put "on mouseup" into line 1 of temp put " " into line 2 of temp put "end mouseup" into line 3 of temp set the script of me to temp end if exit readytoscript end if end readytoScript on deleteLastColor put line 1 of the script of me into line 1 of insertLine delete word 1 of insertLine put the name of me into check if word 1 of check is "bkgnd" then put the script of this bg into holdscript put "bg" into wheretoGo put the name of this bg into myName else put the script of this cd into holdScript put "cd" into wheretoGo put the name of this cd into myName end if get offset (insertLine, holdScript) if it is 0 then answer "This picture has already been deleted" with "Okay" exit deleteLastColor end if get offset ("add", holdScript) if it is 0 then answer "You have already erased all the pictures here" with "I knew that" exit deleteLastColor end if put the number of lines of char 1 to offset(insertLine, holdScript) ¬ of holdscript into KillLine delete line KillLine of holdScript colorizeHC "Erase", rect of me go to this cd do put "This picture has been removed from" && the name of wheretoGo into message do set the script of myName to holdScript end deleteLastColor on changeAttributes put "--" into test -- because using "--" in a repeat structure causes format trouble answer "Do you want this button to create a" && quote & "scaling" & quote && "picture?"¬ with "Cancel" or "Scaling" or "Normal" if it is "Cancel" then exit changeAttributes -- 1 major end if put the script of me into holdScript put offset ("on locateMe", holdScript) into startPoint put startPoint into oldStart put offset ("end locateMe", holdScript) + 11 into endPoint put char startpoint to endPoint of holdScript into newLocateMe delete char startpoint to endPoint of holdScript put offset ("put", newLocateMe) into startPoint put offset ("insertline", newLocateMe) + 10 into endPoint delete char startPoint to endPoint of newLocateMe colorizeHC "erase", the rect of me set the showName of me to false if it is "Normal" then -- foop put "-- " && "colorizeHC" && quote & "add" & quote & "," && quote &¬ -- item 2 of line 2 of the script of me & quote & "," ¬ -- && quote & the topleft of me & quote & "," && quote & the rect of me & quote & "," && quote & "transparent" & quote into line 1 of insertLine -- endfoop put offset ("foop", holdScript) + 4 into startpoint put offset ("endfoop", holdScript) - 4 into stopPoint put char startpoint to stoppoint of holdScript into holdCommand answer "Do you want an opaque or transparent picture to be used?" with¬ "Transparent" or "Opaque" if it is "Transparent" then repeat with x = 1 to the number of lines of holdCommand get word 1 of line x of holdCommand if it is test then delete word 1 of line x of holdCommand end repeat put return & holdCommand after line 1 of newLocateme put newLocateme & return into char oldStart of holdScript colorizeHC "Add", item 2 of line 2 of the script of me, the topleft of me , the rect of me, "transparent" end if -- ** if it is "Opaque" then put offset ("the rect of me", holdCommand) into startpoint put the number of chars of holdCommand into endPoint delete char startpoint to endPoint of holdCommand put space & "rect of me & quote into line 1 of insertline" after last char of holdCommand repeat with x = 1 to the number of lines of holdCommand get word 1 of line x of holdCommand if it is test then delete word 1 of line x of holdCommand end repeat put return & holdCommand after line 1 of newLocateme put newLocateme & return into char oldStart of holdScript colorizeHC "Add", item 2 of line 2 of the script of me, the topleft of me, the rect of me end if -- ** end if -- ** end Normal branch if it is "Scaling" then -- boink put "-- " && "colorizeHC" && quote & "add" & quote & "," && quote &¬ -- item 2 of line 2 of the script of me & quote & "," ¬ -- && quote & the rect of me & quote & "," && "," && quote & "copy with dithering" & quote into line 1 of insertLine -- endboink put offset ("boink", holdScript) + 5 into startpoint put offset ("endboink", holdScript) - 4 into stopPoint put char startpoint to stoppoint of holdScript into holdCommand answer "Do you want an opaque or transparent picture to be used?" with¬ "Transparent" or "Opaque" if it is "Opaque" then repeat with x = 1 to the number of lines of holdCommand get word 1 of line x of holdCommand if it is test then delete word 1 of line x of holdCommand end repeat put return & holdCommand after line 1 of newLocateme put newLocateme & return into char oldStart of holdScript colorizeHC "Add", item 2 of line 2 of the script of me, the rect of me ,, "copy with dithering" end if -- ** if it is "Transparent" then put offset ("copy", holdCommand) into startpoint -- because the default phrase was with "copy" put startpoint + 4 into stoppoint delete char startpoint to stoppoint of holdCommand put "transparent" & space before char startpoint of holdCommand repeat with x = 1 to the number of lines of holdCommand get word 1 of line x of holdCommand if it is test then delete word 1 of line x of holdCommand end repeat put return & holdCommand after line 1 of newLocateme put newLocateme & return into char oldStart of holdScript colorizeHC "Add", item 2 of line 2 of the script of me, the rect of me,, "transparent with dithering" end if -- ** end if -- ** Should end Scaling branch set the script of me to holdScript go to this cd end changeAttributes