Farbflash projects: Imaging lingo table | 3-D scene list | Find all | Handler menu | Lingo message window

source: trunk/lingosource/castlib1/OSCmenu_Utilities.ls

Last change on this file was 250, checked in by alex, 16 months ago

extended the 'open linked script' command to read the first line of the comments to get the filename for a script in case it is NOT a linkes script

File size: 23.1 KB
Line 
1-- OSCmenu_Utilities
2-----------------------------------
3-- CREATED:
4-- 14.12.2008
5--
6-- DESCRIPTION:
7--              This Script defines the contents of the Utilities menu
8--              the handler mShowOSCMenu builds a list with menu entries and corresponding handler calls
9--              there are two lists:
10--                     one hierarchical list with only the menu items text
11--                     and one flat property list which acts as lookup list for each item
12--              The lookup list "translates" the text of a menu entry to the corresponding function
13--                     and "knows" in which scriptmember that function can be found
14--                     so the syntax is:
15--                           ["Menu title": ["function name with paramters", "name of the scriptmember to instantiate"]]
16--
17-- REQUIRES:
18--               script "aleXtrasMovieScript" as provider for library scripts -> xscr()
19--               script "commonMovieScript" to get the globallist -> mGetGlobalList
20--
21-- USAGE:
22--
23-----------------------------------
24
25property pCallerSprite
26property pCallBackParams
27
28property pLookUpCommandList
29-- in order to be able to use nicer command names, we use a lookup list for the real function names
30
31
32on mShowOSCMenu me, callerSprite
33 
34  pCallerSprite = callerSprite
35 
36  isMac = (the last char of the moviepath = ":")
37 
38  li = []
39  pLookUpCommandList = [:]
40 
41 
42  ---------------------------------------------------
43  li.add("Glossary")
44  subli = []
45  li.add(subli)
46 
47  subli.add("Insert current date")
48  pLookUpCommandList.setaprop("Insert current date", ["pasteDate me", "alexUtilities"])
49 
50  subli.add("Insert divider")
51  pLookUpCommandList.setaprop("Insert divider", ["pasteDivider me", "alexUtilities"])
52 
53  subli.add("Insert lingodoc script abstract")
54  pLookUpCommandList.setaprop("Insert lingodoc script abstract", ["snipAbstract me", "alexUtilities"])
55 
56  subli.add("Insert lingodoc handler description")
57  pLookUpCommandList.setaprop("Insert lingodoc handler description", ["snipTitle me", "alexUtilities"])
58 
59  li.add("")
60 
61  if isMac = 1 then
62    ---------------------------------------------------
63    li.add("BBEdit Handlers")
64    subli = []
65    li.add(subli)
66   
67    subli.add("Edit in BBEdit")
68    pLookUpCommandList.setaprop("Edit in BBEdit", ["mEdit_text_with_BBedit me", "bbedit_Utilities"])
69   
70    subli.add("Open in BBEdit")
71    pLookUpCommandList.setaprop("Open in BBEdit", ["mOpen_text_with_BBedit me", "bbedit_Utilities"])
72   
73    subli.add("Refresh members edited in BBEdit")
74    pLookUpCommandList.setaprop("Refresh members edited in BBEdit", ["mReImport_text_Opened_In_BBedit me", "bbedit_Utilities"])
75   
76    subli.add("Open linked script in BBEdit")
77    pLookUpCommandList.setaprop("Open linked script in BBEdit", ["mOpen_Linked_Script_With_BBedit me", "bbedit_Utilities"])
78   
79    subli.add("Diff selected script")
80    pLookUpCommandList.setaprop("Diff selected script with bbdiff", ["mBBDiff_LiveCompare_SelectedScript me", "bbedit_Utilities"])
81   
82    subli.add("Batch compare selected scripts")
83    pLookUpCommandList.setaprop("Batch compare selected scripts", ["mCompareSelectedScriptmembersBatch me", "bbedit_Utilities"])
84   
85  end if
86 
87 
88  li.add("External script editor Handlers")
89  subli = []
90  li.add(subli)
91 
92  subli.add("Edit in external editor")
93  pLookUpCommandList.setaprop("Edit in external editor", ["mEdit_text_in_ext_editor me", "bbedit_Utilities"])
94 
95  subli.add("Open in external editor")
96  pLookUpCommandList.setaprop("Open in external editor", ["mOpen_text_with_ext_editor me", "bbedit_Utilities"])
97 
98  subli.add("Refresh members edited in external editor")
99  pLookUpCommandList.setaprop("Refresh members edited in external editor", ["mReImport_text_Opened_In_ext_editor me", "bbedit_Utilities"])
100 
101  subli.add("Open linked script")
102  pLookUpCommandList.setaprop("Open linked script", ["mOpen_Linked_Script_With_ext_editor me", "bbedit_Utilities"])
103 
104  subli.add("Diff selected scripts")
105  pLookUpCommandList.setaprop("Diff selected scripts", ["mLiveCompare_SelectedScript me, convertLineBreaksToUnix", "bbedit_Utilities"])
106 
107 
108 
109 
110 
111  ---------------------------------------------------
112  li.add("FileIO")
113  subli = []
114  li.add(subli)
115 
116  subli.add("Choose file...")
117  pLookUpCommandList.setaprop("Choose file...", ["mGetFilePathFromUser me", "alexUtilities"])
118 
119  subli.add("Choose folder...")
120  pLookUpCommandList.setaprop("Choose folder...", ["mGetFolderPathFromUser me", "alexUtilities"])
121 
122  subli.add("Read text from file...")
123  pLookUpCommandList.setaprop("Read text from file...", ["mGetTextFromFile me, filepath_optional", "alexUtilities"])
124 
125  subli.add("Get file list from folder...")
126  pLookUpCommandList.setaprop("Get file list from folder...", ["mGetFileList me, folderpath_optional", "alexUtilities"])
127 
128  subli.add("Get folder list from folder...")
129  pLookUpCommandList.setaprop("Get folder list from folder...", ["mGetFolderList me, folderpath_optional", "alexUtilities"])
130 
131 
132  ---------------------------------------------------
133  li.add("XML")
134  subli = []
135  li.add(subli)
136 
137  subli.add("Read XML file...")
138  pLookUpCommandList.setaprop("Read XML file...", ["mReadXML_2_List me", "alexUtilities"])
139 
140  subli.add("Export list to XML file...")
141  pLookUpCommandList.setaprop("Export list to XML file...", ["mSaveList_2_XML me, theList", "alexUtilities"])
142 
143 
144  li.add("")
145 
146 
147  ---------------------------------------------------
148  li.add("Linked Members")
149  subli = []
150  li.add(subli)
151 
152  subli.add("Unlink bitmap members")
153  pLookUpCommandList.setaprop("Unlink bitmap members", ["mUnlinkBitmaps me", "alexUtilities"])
154 
155  subli.add("")
156  subli.add("Link selected text...")
157  pLookUpCommandList.setaprop("Link selected text...", ["mLinkSelectedText me", "alexUtilities"])
158 
159  subli.add("Update all linked texts")
160  pLookUpCommandList.setaprop("Update all linked texts", ["mUpdateAllLinkedTexts me", "alexUtilities"])
161 
162 
163  ---------------------------------------------------
164  li.add("Export Members")
165  subli = []
166  li.add(subli)
167 
168  subli.add("Export selected text as...")
169  pLookUpCommandList.setaprop("Export selected text as...", ["mExportSelectedText me, theType_optional", "alexUtilities"])
170 
171  subli.add("")
172  subli.add("Export selected bitmaps...")
173  pLookUpCommandList.setaprop("Export selected bitmaps...", ["mExportSelectedBMs me, theType_optional, compr_optional, thePath_optional", "alexUtilities"])
174 
175  subli.add("Export to bitmap...")
176  pLookUpCommandList.setaprop("Export to bitmap...", ["mExportBM me, theMember, thePath_optional, theType_optional, compr_optional", "alexUtilities"])
177 
178 
179  ---------------------------------------------------
180  li.add("Export/Import Scriptmembers")
181  subli = []
182  li.add(subli)
183 
184  subli.add("Export script-, text-, fieldmember...")
185  pLookUpCommandList.setaprop("Export script-, text-, fieldmember...", ["mExportScripttext me, skipIcons_optional, convertLineBreaksToUnix_optional, theFolder_optional", "alexUtilities"])
186 
187  subli.add("Import script...")
188  pLookUpCommandList.setaprop("Import script...", ["mImportScriptWithThumbnail me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional", "svn_Utilities"])
189 
190 
191 
192  li.add("")
193 
194  ---------------------------------------------------
195  li.add("Process Castmembers by Name")
196  subli = []
197  li.add(subli)
198 
199  subli.add("Delete Members By Name...")
200  pLookUpCommandList.setaprop("Delete Members By Name...", ["mDeleteMembersByName me, startString", "alexUtilities"])
201 
202  subli.add("")
203  subli.add("Name Members...")
204  pLookUpCommandList.setaprop("Name Members...", ["mNameMemberNames me, newName", "alexUtilities"])
205 
206  subli.add("Prefix/Suffix Names...")
207  pLookUpCommandList.setaprop("Prefix/Suffix Names...", ["mChangeMemName me, praefix, suffix", "alexUtilities"])
208 
209  subli.add("Make numbered names...")
210  pLookUpCommandList.setaprop("Make numbered names...", ["mNumberMemberNames me, numberOfDigits, startnum, theDelimiter, stepSize", "alexUtilities"])
211 
212  subli.add("Replace in name...")
213  pLookUpCommandList.setaprop("Replace in name...", ["mReplaceInMemName me, searchstr, replacestring", "alexUtilities"])
214 
215  subli.add("")
216  subli.add("Fill empty castslots with dummy members")
217  pLookUpCommandList.setaprop("Fill empty castslots with dummy members", ["mFillDummyMember me", "alexUtilities"])
218 
219  subli.add("Erase dummy members")
220  pLookUpCommandList.setaprop("Erase dummy members", ["mRemoveDummyMember me", "alexUtilities"])
221 
222 
223  ---------------------------------------------------
224  li.add("Convert Text into Image with Mask")
225  subli = []
226  li.add(subli)
227 
228  subli.add("Convert to bitmap")
229  pLookUpCommandList.setaprop("Convert to bitmap", ["mConvertToBitmap me", "alexUtilities"])
230 
231 
232  ---------------------------------------------------
233  li.add("Find all Instances in Score")
234  subli = []
235  li.add(subli)
236 
237  subli.add("Find in GPDL...")
238  pLookUpCommandList.setaprop("Find in GPDL...", ["mFindInGPDL me, str_optional", "alexUtilities"])
239 
240  subli.add("Select member in score...")
241  pLookUpCommandList.setaprop("Select member in score...", ["mSelectInScore me, startframe_optional, endframe_optional", "alexUtilities"])
242 
243 
244  li.add("")
245 
246  ---------------------------------------------------
247  li.add("Script Statistics")
248  subli = []
249  li.add(subli)
250 
251  subli.add("Put script stats")
252  pLookUpCommandList.setaprop("Put script stats", ["GetScriptlines me", "alexUtilities"])
253 
254  subli.add("Find all Puts")
255  pLookUpCommandList.setaprop("Find all Puts", ["mListallPuts me", "alexUtilities"])
256 
257 
258  ---------------------------------------------------
259  li.add("Alex Help Miaw Handlers")
260  subli = []
261  li.add(subli)
262 
263  subli.add("Lingo help...")
264  pLookUpCommandList.setaprop("Lingo help...", ["mGetHelp me, theText", "alexUtilities"])
265 
266  subli.add("Create help files from selected members")
267  pLookUpCommandList.setaprop("Create help files from selected members", ["makeHelpEntries me", "alexUtilities"])
268 
269  subli.add("Create members for help files from selected script")
270  pLookUpCommandList.setaprop("Create members for help files from selected script", ["makeHelpFilesFromScript me, memref_optional, onlyHandlerWithComments_optional", "alexUtilities"])
271 
272 
273 
274  if isMac = 1 then
275    --------------------------------------------------- my linked script system:
276    li.add("")
277    li.add("Alex Linked Scripts System")
278    subli = []
279    li.add(subli)
280    subli.add("Link selected alex-linked-library-scripts")
281    pLookUpCommandList.setaprop("Link selected alex-linked-library-scripts", ["mLinkScripts me", "bbedit_Utilities"])
282   
283    subli.add("UnLink selected alex-linked-library-scripts")
284    pLookUpCommandList.setaprop("UnLink selected alex-linked-library-scripts", ["mUnLinkScripts me", "bbedit_Utilities"])
285   
286    subli.add("UnLink all alex-linked-library-scripts")
287    pLookUpCommandList.setaprop("UnLink all alex-linked-library-scripts", ["mUnLinkAllScripts me", "bbedit_Utilities"])
288   
289    subli.add("")
290    subli.add("Open counterpart of selected alex-linked-library-script in BBEdit")
291    pLookUpCommandList.setaprop("Open counterpart of selected alex-linked-library-script in BBEdit", ["mBBedit me", "bbedit_Utilities"])
292   
293    subli.add("Check changes in selected alex-linked-library-scripts")
294    pLookUpCommandList.setaprop("Check changes in selected alex-linked-library-scripts", ["mCheckLSChange me", "bbedit_Utilities"])
295   
296    subli.add("")
297    subli.add("Refresh selected alex-linked-library-scripts")
298    pLookUpCommandList.setaprop("Refresh selected alex-linked-library-scripts", ["mRefreshScripts me", "bbedit_Utilities"])
299   
300    subli.add("")
301    subli.add("Export a list of used alex-linked-library-scripts")
302    pLookUpCommandList.setaprop("Export a list of used alex-linked-library-scripts", ["mExportListOfUsedLinkedScripts me", "bbedit_Utilities"])
303   
304  end if 
305 
306 
307  li.add("")
308  li.add("Compare to SVN")
309  subli = []
310  li.add(subli)
311  subli.add("Compare selected scripts with Working Copy...")
312  pLookUpCommandList.setaprop("Compare selected scripts with Working Copy...", ["mCompareCurrentScriptToWorkingCopy me, convertLineBreaksToUnix", "svn_Utilities"])
313 
314  subli.add("Export selected script to Working Copy and Open...")
315  pLookUpCommandList.setaprop("Export selected script to Working Copy and Open...", ["mExportCurrentScriptToWorkingCopyAndOpen me, convertLineBreaksToUnix", "svn_Utilities"])
316 
317 
318 
319  li.add("")
320  li.add("Subversion SVN")
321  svn_subli = []
322  li.add(svn_subli)
323 
324  ---------------------------------------------------- most used svn functions:
325  svn_subli.add("SVN Quicklinks")
326  subli = []
327  svn_subli.add(subli)
328 
329  subli.add("SVN Update all castlibs")
330  pLookUpCommandList.setaprop("SVN Update all castlibs", ["mSVN_Update_AllCastlib_and_source me, chooseNewPath_optional, onlyUpdate_SVN_WorkingFolder_optional, revisionNumber_optional", "svn_Utilities"])
331 
332  subli.add("SVN Update selected castlib(s)...")
333  pLookUpCommandList.setaprop("SVN Update selected castlib(s)...", ["mSVN_Update_SelectedCastlib_and_source me, chooseNewPath_optional, onlyUpdate_SVN_WorkingFolder_optional, selectionList_optional, revisionNumber_optional", "svn_Utilities"])
334 
335  subli.add("")
336 
337  subli.add("SVN Commit selected castlib(s) (and scripttext)...")
338  pLookUpCommandList.setaprop("SVN Commit selected castlib(s) (and scripttext)...", ["mSVN_Commit_SelectedCastlib_AND_Scripttext me, chooseNewPath_optional, commitMsg, selectionList_optional", "svn_Utilities"])
339 
340 
341 
342  ---------------------------------------------------- scripttext export functions:
343  svn_subli.add("Scripttext ex/import for SVN")
344  subli = []
345  svn_subli.add(subli)
346  subli.add("Export scripts to SVN working copy...")
347  pLookUpCommandList.setaprop("Export scripts to SVN working copy...", ["mExportScriptsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional", "svn_Utilities"])
348 
349  subli.add("Import script from file...")
350  pLookUpCommandList.setaprop("Import script from file...", ["mImportScriptWithThumbnail me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional", "svn_Utilities"])
351 
352  subli.add("")
353  subli.add("SVN Update ScriptText in Working Copy...")
354  pLookUpCommandList.setaprop("SVN Update ScriptText in Working Copy...", ["mSVN_Update_Working_Copy_ScriptText me, revisionNumber_optional, chooseNewPath_optional, selectionOnly_optional", "svn_Utilities"])
355 
356  subli.add("")
357  subli.add("SVN Import Scripts, Text and Fields from working copy...")
358  pLookUpCommandList.setaprop("SVN Import Scripts, Text and Fields from working copy...", ["mSVN_Update_And_Import_ScriptsFromFolder me, chooseNewPath_optional, selectionOnly_optional", "svn_Utilities"])
359 
360 
361  subli.add("")
362  subli.add("SVN Commit ScriptText only...")
363  pLookUpCommandList.setaprop("SVN Commit ScriptText only...", ["mSVN_Commit_CurrentScripts_ScriptText me, selected_Members_Only_optional", "svn_Utilities"])
364 
365 
366  --  subli.add("")
367  --  subli.add("SVN Delete Selected Scripts...")
368  --  pLookUpCommandList.setaprop("SVN Delete Selected Scripts...", ["mSVN_Delete_Selected_Scripts me, chooseNewPath_optional", "svn_Utilities"])
369 
370 
371 
372  ---------------------------------------------------- svn functions:
373 
374  svn_subli.add("")
375  svn_subli.add("Fields and text ex/import for SVN")
376  subli = []
377  svn_subli.add(subli)
378 
379  subli.add("Export text members to SVN working copy...")
380  pLookUpCommandList.setaprop("Export text members to SVN working copy...", ["mExportTextAndFieldsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional", "svn_Utilities"])
381 
382  subli.add("Import text from SVN working copy...")
383  pLookUpCommandList.setaprop("Import text from SVN working copy...", ["mImportTextAndFields me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional", "svn_Utilities"])
384 
385  subli.add("")
386  subli.add("SVN Import Scripts, Text and Fields from working copy...")
387  pLookUpCommandList.setaprop("SVN Import Scripts, Text and Fields from working copy...", ["mSVN_Update_And_Import_ScriptsFromFolder me, chooseNewPath_optional, selectionOnly_optional", "svn_Utilities"])
388 
389 
390  ----------------------------------------------------
391 
392 
393  svn_subli.add("")
394  svn_subli.add("SVN -- binary director files")
395  subli = []
396  svn_subli.add(subli)
397 
398  subli.add("SVN Update selected castlib...")
399  pLookUpCommandList.setaprop("SVN Update selected castlib...", ["mSVN_Update_SelectedCastlib me, chooseNewPath_optional, onlyUpdate_SVN_WorkingFolder_optional, selectionList_optional, revisionNumber_optional", "svn_Utilities"])
400 
401  subli.add("SVN Update Current Movie...")
402  pLookUpCommandList.setaprop("SVN Update Current Movie...", ["mSVN_Update_CurrentMovie_Binaries me, chooseNewPath_optional, onlyUpdate_SVN_WorkingFolder_optional, revisionNumber_optional", "svn_Utilities"])
403 
404  subli.add("")
405  subli.add("SVN Commit selected castlib...")
406  pLookUpCommandList.setaprop("SVN Commit selected castlib...", ["mSVN_Commit_SelectedCastlib me, chooseNewPath_optional, commitMsg", "svn_Utilities"])
407 
408  subli.add("SVN Commit current Movie...")
409  pLookUpCommandList.setaprop("SVN Commit current Movie...", ["mSVN_Commit_CurrentMovie_Binaries me, chooseNewPath_optional, commitMsg", "svn_Utilities"])
410 
411  ----------------------------------------------------
412 
413  svn_subli.add("")
414  svn_subli.add("SVN -- binary AND text")
415  subli = []
416  svn_subli.add(subli)
417 
418  subli.add("SVN Commit selected Castlib AND Scripttext...")
419  pLookUpCommandList.setaprop("SVN Commit selected Castlib AND Scripttext...", ["mSVN_Commit_SelectedCastlib_AND_Scripttext me, chooseNewPath_optional, commitMsg, selectionList_optional", "svn_Utilities"])
420 
421  subli.add("SVN Commit current Movie AND Scripttext...")
422  pLookUpCommandList.setaprop("SVN Commit current Movie AND Scripttext...", ["mSVN_Commit_CurrentMovie_Binaries_AND_Scripttext me, chooseNewPath_optional, commitMsg", "svn_Utilities"])
423 
424  ----------------------------------------------------
425 
426 
427  li.add("")
428 
429  li.add("Misc.")
430  subli = []
431  li.add(subli)
432 
433  subli.add("Convert textmember to HTML + copy to clipboard")
434  pLookUpCommandList.setaprop("Convert textmember to HTML + copy to clipboard", ["mCopyConvert2HTML", "alexUtilities"])
435 
436 
437  ---------------------------------------------------
438  subli.add("Fix colors in scriptlists (SES 10 -> SES 9)")
439  pLookUpCommandList.setaprop("Fix colors in scriptlists (SES 10 -> SES 9)", ["Authoring_ExchangeScriptListColorsToRGBs me", "alexUtilities"])
440 
441 
442  if isMac = 1 then
443    ---------------------------------------------------
444    li.add("Unix path")
445    subli = []
446    li.add(subli)
447   
448    subli.add("Convert path from HFS to UNIX")
449    pLookUpCommandList.setaprop("Convert path from HFS to UNIX", ["mConvertHFS2Unix me, string_HFSPath", "alexUtilities"])
450    subli.add("Convert path from UNIX to HFS")
451    pLookUpCommandList.setaprop("Convert path from UNIX to HFS", ["mConvertUnix2HFS me, string_UnixPath", "alexUtilities"])
452   
453  end if
454 
455  li.add("")
456 
457  ---------------------------------------------------
458  li.add("Castmember Thumbnails")
459  subli = []
460  li.add(subli)
461 
462  subli.add("Make castlib label...")
463  pLookUpCommandList.setaprop("Make castlib label...", ["makeLabel me, theContent, theBackgroundColor_optional, memberRef_optional", "alexUtilities"])
464 
465 
466  ---------------------------------------------------
467 
468  li.add("")
469  if the platform contains "mac" then fnd = "Finder"
470  else fnd = "Explorer"
471  li.add("Open containing folder in" && fnd)
472  pLookUpCommandList.setaprop("Open containing folder in" && fnd, ["mOpenContainingFolder me", "alexUtilities"])
473 
474 
475 
476 
477  --------------------------------------------------
478  ---------------------------------
479  li.add("My own handlers")
480  subli = []
481  li.add(subli)
482 
483  menuString = "Do some custom stuff"
484  handlerNameWithParameters = "Add_Your_Own_Handler_Here me"
485  parentScriptName = "custom_Utilities"
486 
487  subli.add(menuString)
488  pLookUpCommandList.setaprop(menuString, [handlerNameWithParameters, parentScriptName])
489 
490  -- USAGE NOTES:
491  -- <menuString> is what appear visible in th menu
492  -- <handlerNameWithParameters> is what is called in script <parentScriptName>
493  -- provide the required or optional paramters to <handlerNameWithParameters>
494  -- -- -- so the MUI dialog "knows" what to "ask" for
495  ---------------------------------
496  --------------------------------------------------
497 
498 
499 
500 
501  r = (the activewindow).rect
502  p = sprite(me.spritenum).rect.offset(r.left, r.top)
503 
504 
505  if sprite(me.spritenum).member.type = #OSmenu then
506   
507    mConvertToOSC li
508   
509    sprite(me.spritenum).itemList = li
510    sprite(me.spritenum).click()
511   
512  else
513   
514    theResult = bmMenuAt(li, 16, p[1], p[4])
515   
516    if count(theResult) > 0 then
517      mOSCCallback me, 0, 0, theResult.getLast()
518    end if
519   
520  end if
521 
522end
523
524-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
525
526
527on update me, theIndex, theName
528  pCallBackParams = []
529  pCallBackParams.add(theIndex)
530  pCallBackParams.add(theName)
531  xscr().mCreateTimeOut("osc_callback_to", 10, #mOSCCallback, me)
532  -- break the event chain up, because when the event was generated in the xtra, we do not get error messages in lingo
533end
534
535-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
536
537on mOSCCallback me, dto, theIndex, theName
538 
539  if ilk(dto) = #timeout then dto.forget()
540 
541  if listP(pCallBackParams) then
542    if count(pCallBackParams) > 0 then theIndex = pCallBackParams[1]
543    if count(pCallBackParams) > 1 then theName = pCallBackParams[2]
544  end if
545  pCallBackParams = 0
546 
547 
548  if length(theName) then
549   
550    -- some of the functions are "translated" and appear in a lookup list, in order to have nicer names
551    cmdli = pLookUpCommandList.getaprop(theName)
552    if not(listP(cmdli)) then
553      cmdli = [theName, "alexUtilities"]
554    else
555      if count(cmdli) < 1 then exit
556      if count(cmdli) < 2 then cmdli.add("alexUtilities")
557      theName = string(cmdli[1])
558    end if
559   
560   
561    if theName = "mCopyConvert2HTML" then
562     
563      -- this handler must be hardcoded unfortunately
564      -- as it requires a moviescript for the callback
565      -- while it would be possible, I don't like to create
566      -- a temp moviescript in the users movie and delete it when done
567      -- instead of this exception...
568      mCopyConvert2HTML
569     
570    else
571     
572      cmdStr = cmdli[1]
573      targetScriptName = cmdli[2]
574     
575      cmd = cmdStr.word[1]
576      delete word 1 of cmdStr
577     
578      glob = xscr().mGetGlobalList()
579     
580      olddelim = the itemdelimiter
581      the itemdelimiter = ","
582      delete item 1 of cmdStr
583      the itemdelimiter = olddelim
584     
585      glob[#cmd] = cmd
586      glob[#theParams] = [:]
587     
588      glob[#copy2ClipBoard] = 0
589     
590      targetScriptObject = new(script targetScriptName)
591      targetScriptObject.setaprop(#pHandlerMenuWindowName, (the activewindow).name)
592      glob[#theTargetInstance] = targetScriptObject
593     
594      if cmdStr.word.count then
595        mShowMui cmdStr
596      else
597        mDoCmd
598      end if
599    end if
600   
601  end if
602 
603  if ilk(pCallerSprite) = #integer then
604    sendSprite(pCallerSprite, #mUnhilite)
605  end if
606 
607end
608
609-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
610
611on mouseUp me
612  if ilk(pCallerSprite) = #integer then
613    sendSprite(pCallerSprite, #mUnhilite)
614  end if
615end
Note: See TracBrowser for help on using the repository browser.