Table of Contents
BBEdit utility handlers
These handlers only show up if the platform contains "mac", as BBEdit is a mac application. BBEdit is a professional code editor for mac. It's price tag is high for a code editor, but I think it is worth any single cent, as it can be a huge time saver and is the swiss army knife for code on the mac. Make sure, that you instal the bbedit command line tool, so these functions can use the shell xtra to invoke bbedit and bbdiff.
Sure enough it ought to be easy to adjust these handlers to work with other apps like for example the also very great open source app Smultron
I am also sure, that there are windows apps, which may offer the same functionality like BBEdit does on the mac, but bear with me, I am not the person to ask, when it comes to windows solutions. I would be glad though, if someone told me which app could be addressed on windows in lieu of BBEdit.
Edit in BBEdit
This command writes the scripttext of the currently selected script to a temporary file and opens the file in bbedit in a way, that the process waits until the user closes the file in bbedit and then automatically returns to the caller. In the next line of lingo code the temp file is read back into the script. This the changes made in bbedit will be incorporated in the lingo script castmember. So to speak it is a synchronous call. You can open your script in bbedit, save and close and you will automatically be back in director with the modified script.
Open in BBEdit
Since the command "Edit in BBEdit" will only be able to handle one single script at a time, this is another method to achieve a similar functionality with more than only one script. This call exports the scripttext of every selected script member to tempfiles and opens them in BBEdit. Now after completing editing and saving the changes in bbedit, choose the below Refresh members edited in BBEdit command to read the modified tempfiles back in. Please be aware of the fact, that this call uses the castmember name as filename to write AND read back in the temporary file. So duplicate names and the like may lead to unwanted results.
Refresh members edited in BBEdit
This command reads the file with the castmember name from /tmp. So if your castmember's name is myScript the call attempts to read /tmp/myScript.ls. This command is meant as counterpart to Open in BBEdit in order to work with more than one script at a time in BBEdit.
Open linked script
Open the linked script with BBEdit for all selected members of type script, which are linked scripts (=> filename.length > 0)
Diff selected script
This command compares two selected scriptmebers using the commandline utility bbdiff, which displays the differences in BBEdit. First it exports the scripttext to temporary files and calls BBEdit in an synchronous way, so that director "waits" until the Diffs window in BBedit was closed. As soon as that happens the focus returns to Director and the temp files are read back in. So you can make changes to the files in BBEdit, save the changes and close the diffs window in order to return to Director and have the changes incorporated into the selected scripts.
Batch compare selected scripts
This command compares two or more selected scriptmebers using the commandline utility bbdiff, which displays the differences in BBEdit. Note that the total number of selected script castmembers is divided by 2 and the first of the "first half" is compared to the first of the "second half", the second of the "first half" is compared to the second of the "second half" and so on. So if you select 10 members member 1 is compared to member 6, member 2 is compared to member 7, member 3 is compared to member 8, member 4 is compared to member 9 and member 5 is compared to member 10. So you can compare one block of members against another block of members. Usually I simply copy a block of scriptmembers in the old version and paste it temporarely into the castlib of the new version of a movie, then I select both blocks and compare. This will open the BBEdit results window and I can see the changes from one version to the other. Be aware of the fact, that this works with text and field members also.
