How do I test a property value in Applescript?
Hi,
I'm attempting to write an applescript to sit in a subgraph object. the aim of the script is to toggle the state of the subgraph. I am failing to get my if statement to work and have tried all sorts of incorrect syntax. Please correct my code [CODE]tell application "OmniGraffle Professional 5" tell canvas of front window set theProps to (get the properties of subgraph -1) if theProps(collapsed) then --display dialog "I'm Collapsed" --else --display dialog "I'm Expanded" end if --set properties of subgraph -1 to {collapsed:true} end tell end tell[/CODE] best wishes Simon |
I think in theory you should be able to use something like this:
[CODE]tell application id "OGfl" tell self set blnCollapsed to ((collapsed) as boolean) set collapsed to not blnCollapsed end tell end tell[/CODE] or even just [CODE]tell self set collapsed to not collapsed end tell[/CODE] but I notice that an error message is generated in Presentation mode, though it seems to work from the Run Script button of the Action inspector. A case for [B]Help > Send Feedback[/B] ? |
Analogous to [URL="http://forums.omnigroup.com/showthread.php?t=10992"]this issue[/URL], perhaps ?
|
Thanks for the code.I have sent an email reporting the strange behaviour which also occurs in the editing mode.
best wishes Simon |
[QUOTE=Simon Knight;106589]Thanks for the code.I have sent an email reporting the strange behaviour which also occurs in the editing mode.[/QUOTE]
Good luck ! I also attempted to report the bug, (which boils down, I think, to the fact that well-formed scripts which compile and run in the Action inspector dialog may fail to resolve references in Edit or Presentation mode) but the response was a "proceed to self-service" message :-) [INDENT][I]Currently, we are unable to assist in troubleshooting custom scripting. That said, if you post your script question within the "AppleScripting Omni Apps" forum you should be able to find help from other folks in the dev community.[/I][/INDENT] Entering infinite loop territory here ... [COLOR="White"]--[/COLOR] |
Have you tried that (named) forum ?
|
No need - it's a bug, now acknowledged and recorded.
(The bug-reporting process just needed a slightly more vigorous prod - we all have those moments :-) |
All times are GMT -8. The time now is 11:16 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.