The Omni Group Forums

The Omni Group Forums (
-   AppleScripting Omni Apps (
-   -   Moving object after click action (

humankapital 2012-02-17 03:52 AM

Moving object after click action

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! :)


RobTrew 2012-02-17 06: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 06:50 AM

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

All times are GMT -8. The time now is 04:20 AM.

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