The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   AppleScripting Omni Apps (http://forums.omnigroup.com/forumdisplay.php?f=46)
-   -   Moving object after click action (http://forums.omnigroup.com/showthread.php?t=23504)

humankapital 2012-02-17 02:52 AM

Moving object after click action
 
Hello,

I'm badly stuck with a task here and need the help of some experts.

This is what I want to do: When clicking on an object (shape) in presentation mode, one or more other objects should move (by changing their origin?). Sounds quite easy, but unfortunately my Applescript knowledge is less than none.

Maybe someone can point me to the right direction? Thanks in advance! :)

Johannes

RobTrew 2012-02-17 05:21 AM

I'm not sure that this kind of thing really works all that well - the screen updating seems a bit intermittent. Dbl-click, wait a bit, may work or may not, then suddenly moves twice ... not ideal for real presentations ...

[CODE]tell application id "OGfl"
-- Get the unique Id of the shape which contains the action script
set lngId to id of self

-- apply a movement to all the other shapes on the canvas
tell canvas of self
repeat with oShape in (shapes where id is not lngId)
set lstOrigin to origin of oShape
set item 1 of lstOrigin to (item 1 of lstOrigin) + 100
set origin of oShape to lstOrigin
end repeat
end tell
end tell[/CODE]

humankapital 2012-02-17 05:50 AM

Thank you so much, Rob! It works perfect for my purpose!


All times are GMT -8. The time now is 05:30 AM.

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