On Jul 17, 2007, at 9:58 PM, Tariel Gogoberidze wrote:

Well, the question is where to save this information. The least intrusive method would be probably to external file?
In this case something like script below may probably do it...


Sorry, I wrote that script off the top of my head, the one below at least have some theoretical chance to work .. :)

on RememberIDEstacksPositions
  put StoragePositionsPath () into FL
  if there is a file FL then
    put url ("file:"&FL) into tPositions
    repeat for each line L in tPositions
      put item 2 to 3 of L into tArray [item 1 of L]
    end repeat
  end if
  put the openStacks into tOpenStacksList
  set the itemDel to "/"
  put "mchome.mc/mctools.mc/mchelp.mc" into tMCIDEstacks
  repeat for each line L in tOpenStacksList
if last item of the effective filename of stack L is among the items of tMCIDEstacks then
      put the loc of stack L into tArray [L]
    end if
  end repeat
  combine tArray using cr and comma
  put tArray into url ("file:"&FL)
end RememberIDEstacksPositions

on RestoreIDEstackPositions tStack
 -- tStack = IDE stack that is opening
  put StoragePositionsPath () into FL
  if there is a file FL then
    put url ("file:"&FL) into tPositions
    repeat for each line L in tPositions
      if item 1 of L = tStack then
        set the loc of stack tStack to (item 2 to 3 of L)
        -- if user changed resolution or monitor
        put the windowBoundingRect into tMonitorRect
        if (the left of stack tStack) + 10 > item 3 of tMonitorRect then
set the left of stack tStack to the left of stack tStack - 100 -- to make it accessable
        end if
        if the top of stack tStack > item 4 of tMonitorRect then
          set the top of stack tStack to item 4 of tMonitorRect - 100
        end if
      end if
    end repeat
  end if
end RestoreIDEstackPositions


function StoragePositionsPath
  set the itemDel to "/"
return item 1 to -2 of the effective fileName of stack "home" & "/IDEstackPositions.txt"
end StoragePositionsPath


best regards
Tariel


_______________________________________________
metacard mailing list
[email protected]
http://lists.runrev.com/mailman/listinfo/metacard

Reply via email to