| | 551 | #pragma mark Applescript |
|---|
| | 552 | - (AIStatusTypeApplescript)statusTypeApplescript |
|---|
| | 553 | { |
|---|
| | 554 | AIStatusType statusType = [self statusType]; |
|---|
| | 555 | AIStatusTypeApplescript statusTypeApplescript; |
|---|
| | 556 | |
|---|
| | 557 | switch (statusType) { |
|---|
| | 558 | case AIAvailableStatusType: statusTypeApplescript = AIAvailableStatusTypeAS; break; |
|---|
| | 559 | case AIAwayStatusType: statusTypeApplescript = AIAwayStatusTypeAS; break; |
|---|
| | 560 | case AIInvisibleStatusType: statusTypeApplescript = AIInvisibleStatusTypeAS; break; |
|---|
| | 561 | case AIOfflineStatusType: |
|---|
| | 562 | default: |
|---|
| | 563 | statusTypeApplescript = AIOfflineStatusTypeAS; break; |
|---|
| | 564 | } |
|---|
| | 565 | |
|---|
| | 566 | return statusTypeApplescript; |
|---|
| | 567 | } |
|---|
| | 568 | |
|---|
| | 569 | - (void)setStatusTypeApplescript:(AIStatusTypeApplescript)statusTypeApplescript |
|---|
| | 570 | { |
|---|
| | 571 | AIStatusType statusType; |
|---|
| | 572 | |
|---|
| | 573 | switch (statusTypeApplescript) { |
|---|
| | 574 | case AIAvailableStatusTypeAS: statusType = AIAvailableStatusType; break; |
|---|
| | 575 | case AIAwayStatusTypeAS: statusType = AIAwayStatusType; break; |
|---|
| | 576 | case AIInvisibleStatusTypeAS: statusType = AIInvisibleStatusType; break; |
|---|
| | 577 | case AIOfflineStatusTypeAS: |
|---|
| | 578 | default: |
|---|
| | 579 | statusType = AIOfflineStatusType; break; |
|---|
| | 580 | } |
|---|
| | 581 | |
|---|
| | 582 | [self setStatusType:statusType]; |
|---|
| | 583 | } |
|---|
| | 584 | |
|---|
| | 585 | - (NSScriptObjectSpecifier *)objectSpecifier { |
|---|
| | 586 | NSArray *graphics = [[self document] graphics]; |
|---|
| | 587 | // 1 |
|---|
| | 588 | unsigned index = [graphics indexOfObjectIdenticalTo:self]; |
|---|
| | 589 | // 2 |
|---|
| | 590 | if (index != NSNotFound) { |
|---|
| | 591 | NSScriptObjectSpecifier *containerRef = [[self document] objectSpecifier]; |
|---|
| | 592 | // 3 |
|---|
| | 593 | return [[[NSIndexSpecifier allocWithZone:[self zone]] |
|---|
| | 594 | initWithContainerClassDescription:[containerRef keyClassDescription] |
|---|
| | 595 | containerSpecifier:containerRef key:@"graphics" index:index] autorelease]; |
|---|
| | 596 | // 4 |
|---|
| | 597 | } else { |
|---|
| | 598 | return nil; |
|---|
| | 599 | // 5 |
|---|
| | 600 | } |
|---|
| | 601 | } |
|---|