On Thu, 31 May 2007 15:20:55 -0400 Shari  wrote:

So that means any MC solution cannot take you from script to script to edit?

Shari,

If you really want HyperCard style "ss" search, try the solution I posted 2 days ago on this list. It's a hack but if you would not open and close stacks while handler takes you from script to script, it would work. When you close the script window the handler would take you to the script of next object that contains the search string.

If something goes wrong or you want to stop handler taking you from script to script, just press command + shift key simultaneously.

Below is modified HyperCard "ss" handler.
You can include substacks in search by "put the substacks of this stack" and loop through resulting list as well.


on mouseUp
  ss
end mouseUp

on ss tSearchWhat,stackName
  global ScriptFindString -- HyperTalk global variable
  set lockRecent to true
  push card -- remember where we are
  if tSearchWhat is empty then
    ask "Search for what string?" with ScriptFindString -- ∆
    if (it is empty) or (the result is "Cancel") then exit searchScript
put it into tSearchWhat -- otherwise use it as the search tSearchWhat
  end if
  put tSearchWhat into ScriptFindString
  set lockMessages to true -- avoid open messages
  if stackName is not empty then
    go to stack stackName
  end if
  set lockMessages to false
  if the script of this stack contains tSearchWhatthen then
    edit script of this stack
    HoldTheExecution
  end if
  repeat with curCard = 1 to the number of cards
    if the script of card curCard contains tSearchWhat then
      edit the script of card curCard
      HoldTheExecution
    end if
    repeat with curControl = 1 to the number of controls
      if the script of control curControl contains tSearchWhat then
        edit the script of control curControl of card curCard
        HoldTheExecution
      end if
    end repeat
  end repeat
end ss


on HoldTheExecution
  set the cursor to iBeam
  put number of lines of the OpenStacks into N
  repeat until number of lines of the OpenStacks < N
    if the commandkey is down and the shiftkey is down then exit to top
    wait for messages
  end repeat
end HoldTheExecution

best regards
Tariel
_______________________________________________
metacard mailing list
metacard@lists.runrev.com
http://lists.runrev.com/mailman/listinfo/metacard

Reply via email to