This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Lua Scripts
 General Action Scripts
 conditional action script
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

breakcore

Russia
74 Posts

Posted - 09/01/2012 :  13:22:33  Show Profile
Hi, Rob, I'm still exciting by S+

I wanted to ask if action scripts have if/else-like functionality? (Sometimes I need to send certain keys by wheelup/wheeldown depending on cursor position (or something else). For example for Adobe AE I have set wheelup/wheeldown [+r mouse key] gestures to zoom in/out the timeline which is on the right side of the screen, the script just sends to AE the hotkeys. But when the cursor is on the left side I would rather circle the blending modes of the layers by sending another hotkeys by the same gesture with the same script
The wheelup/wheeldown[+right][+middle] and wheelup/wheeldown[+right][+middle][+left] already occupied by global actions.


Thank you!
I cannot imagine my daily life without S+

Edited by - breakcore on 09/01/2012 13:23:51

Rob

USA
2615 Posts

Posted - 09/01/2012 :  15:25:09  Show Profile  Visit Rob's Homepage
I'm glad to hear you're enjoying S+!

You sure can do what you're looking for, if you happen to know the exact X coordinate after which you want to be considered the right side, just change 1000 below to the X coordinate. Otherwise, use the first line of the script to find the X coordinate of the mouse location, then update 1000 to be wherever you want to switch from left to right processing
acMessageBox(acGetMouseLocationX(), "Mouse X", nil) --only use to find the X mouse coordinate, then remove

if acGetMouseLocationX() <= 1000 then
	acMessageBox("Do left side stuff here","Left",nil)
else 
	acMessageBox("Do right side stuff here","Right",nil)
end
Go to Top of Page

breakcore

Russia
74 Posts

Posted - 09/01/2012 :  16:25:46  Show Profile
quote:
Originally posted by Rob

I'm glad to hear you're enjoying S+!

You sure can do what you're looking for, if you happen to know the exact X coordinate after which you want to be considered the right side, just change 1000 below to the X coordinate. Otherwise, use the first line of the script to find the X coordinate of the mouse location, then update 1000 to be wherever you want to switch from left to right processing
acMessageBox(acGetMouseLocationX(), "Mouse X", nil) --only use to find the X mouse coordinate, then remove

if acGetMouseLocationX() <= 1000 then
	acMessageBox("Do left side stuff here","Left",nil)
else 
	acMessageBox("Do right side stuff here","Right",nil)
end




Yes! Just what i needed
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000