The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniGraffle > OmniGraffle General
FAQ Members List Calendar Today's Posts

 
Applescript to re-order objects by x,y coords? Thread Tools Search this Thread Display Modes
Ah ok. Good tip.

Oh, that's what "p" "lst" probably means too =)

The script as it stands throws an error of "The variable plstSeen is not defined" at the line if not (plstSeen contains lngID) then
 
Oh, just realised it needs to be a property since it's a list of all nodes seen so far (to avoid cross links revisiting), not just nodes seen in this particular calling of the function, and thus needs to store values across multiple calls and recursive calls.

So, example code might be

Code:
on run
  tell application id "OGfl"
    tell front window
      set theSelection to the selection
      if theSelection is not {} then
        set plstSeen to {} -- initialise for a new tree
        set theResult to my GetChildren(item 1 of theSelection, 2)
      end if
    end tell
  end tell
end run

property plstSeen : {} -- persistent storage of seen nodes
on GetChildren(oParent, iAxis)
  -- etc
end GetChildren
 
 





All times are GMT -8. The time now is 11:14 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.