Projects
Home     Blog     Install     New Ticket     View Tickets     Browse Source

Ticket #14 (closed defect: fixed)

Opened 9 months ago

Last modified 3 months ago

getting format from artwork doesn't work

Reported by: jordan.breeding@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.3
Component: MacRuby Keywords:
Cc:

Description

In dealing with iTunes and scriptingbridge you can not currently get the format of an artwork item:

irb(main):014:0> tracks.get.arrayByApplyingSelector("artworks").objectAtIndex(0).objectAtIndex(0).format
NoMethodError: private method `format' called for #<ITunesArtwork:0x1211c50>
	from (irb):14
	from /usr/local/lib/ruby/1.9.0/irb.rb:149:in `block (2 levels) in eval_input'
	from /usr/local/lib/ruby/1.9.0/irb.rb:262:in `signal_status'
	from /usr/local/lib/ruby/1.9.0/irb.rb:146:in `block in eval_input'
	from /usr/local/lib/ruby/1.9.0/irb.rb:145:in `eval_input'
	from /usr/local/lib/ruby/1.9.0/irb.rb:69:in `block in start'
	from /usr/local/lib/ruby/1.9.0/irb.rb:68:in `catch'
	from /usr/local/lib/ruby/1.9.0/irb.rb:68:in `start'
	from /usr/local/bin/irb:12:in `<main>'

format is in the method list:

irb(main):009:0> tracks.get.arrayByApplyingSelector("artworks").objectAtIndex(0).objectAtIndex(0).methods.sort
=> [:!, :!=, :"!=:", :!~, :==, :"==:", :===, :=~, :"CA_addValue:multipliedBy:", :"CA_copyJSValue:", :CA_copyRenderValue, :"CA_distanceToValue:", :"CA_interpolateValue:byFraction:", :CI_affineTransform, :CI_rect, :__id__, :__send__, :_accessibilityUIElementPath, :"_accessibilityUIElementPathForChild:", :"_addObserver:forProperty:options:context:", :"_addOptionValue:toArray:withKey:type:", :"_addPlaceholderOptionValue:isDefault:toArray:withKey:binder:binding:", :_asScriptTerminologyNameArray, :_asScriptTerminologyNameString, :"_bind:toController:withKeyPath:valueTransformerName:options:existingNibConnectors:connectorsToRemove:connectorsToAdd:", :"_binderClassForBinding:withBinders:", :"_binderForBinding:withBinders:createAutoreleasedInstanceIfNotFound:", :"_binderWithClass:withBinders:createAutoreleasedInstanceIfNotFound:", :_bindingAdaptor, :"_bindingInformationWithExistingNibConnectors:availableControllerChoices:", :_cfTypeID, :"_cleanupBindingsWithExistingNibConnectors:exception:", :"_compatibility_takeValue:forKey:", :"_conformsToProtocolNamed:", :_copyDescription, :"_createKeyValueBindingForKey:name:bindingType:", :"_didChangeValuesForKeys:", :_implicitObservationInfo, :"_invokeSelector:withArguments:onKeyPath:", :_isAXConnector, :_isKVOA, :_localClassNameForClass, :"_notifyObserversForKeyPath:change:", :"_oldValueForKey:", :"_oldValueForKeyPath:", :"_optionDescriptionsForBinding:", :"_placeSuggestionsInDictionary:acceptableControllers:boundBinders:binder:binding:", :_releaseBindingAdaptor, :"_removeObserver:forProperty:", :"_scriptingAddObjectsFromArray:toValueForKey:", :"_scriptingAddObjectsFromSet:toValueForKey:", :"_scriptingAddToReceiversArray:", :"_scriptingAlternativeValueRankWithDescriptor:", :"_scriptingArrayOfObjectsForSpecifier:", :"_scriptingCanAddObjectsToValueForKey:", :"_scriptingCanHandleCommand:", :"_scriptingCanInsertBeforeOrReplaceObjectsAtIndexes:inValueForKey:", :"_scriptingCanSetValue:forSpecifier:", :"_scriptingCoerceValue:forKey:", :"_scriptingCopyWithProperties:forValueForKey:ofContainer:", :_scriptingCount, :_scriptingCountNonrecursively, :"_scriptingCountOfValueForKey:", :"_scriptingDescriptorOfComplexType:orReasonWhyNot:", :"_scriptingDescriptorOfEnumeratorType:orReasonWhyNot:", :"_scriptingDescriptorOfObjectType:orReasonWhyNot:", :"_scriptingDescriptorOfValueType:orReasonWhyNot:", :"_scriptingIndexOfObjectForSpecifier:", :"_scriptingIndexOfObjectWithName:inValueForKey:", :"_scriptingIndexOfObjectWithUniqueID:inValueForKey:", :"_scriptingIndexesOfObjectsForSpecifier:", :"_scriptingIndicesOfObjectsAfterValidatingSpecifier:", :"_scriptingIndicesOfObjectsForSpecifier:count:", :"_scriptingInsertObject:inValueForKey:", :"_scriptingInsertObjects:atIndexes:inValueForKey:", :"_scriptingMightHandleCommand:", :"_scriptingObjectAtIndex:inValueForKey:", :"_scriptingObjectCountInValueForKey:", :"_scriptingObjectForSpecifier:", :"_scriptingObjectWithName:inValueForKey:", :"_scriptingObjectWithUniqueID:inValueForKey:", :"_scriptingObjectsAtIndexes:inValueForKey:", :"_scriptingRemoveAllObjectsFromValueForKey:", :"_scriptingRemoveObjectsAtIndexes:fromValueForKey:", :"_scriptingRemoveValueForSpecifier:", :"_scriptingReplaceObjectAtIndex:withObjects:inValueForKey:", :"_scriptingSetOfObjectsForSpecifier:", :"_scriptingSetValue:forKey:", :"_scriptingSetValue:forSpecifier:", :_scriptingShouldCheckObjectIndexes, :"_scriptingValueForKey:", :"_scriptingValueForSpecifier:", :"_setBindingAdaptor:", :"_setObject:forBothSidesOfRelationshipWithKey:", :"_suggestedControllerKeyForController:binding:", :"_supportsGetValueWithNameForKey:perhapsByOverridingClass:", :"_supportsGetValueWithUniqueIDForKey:perhapsByOverridingClass:", :"_unbind:existingNibConnectors:connectorsToRemove:connectorsToAdd:", :"_willChangeValuesForKeys:", :"accessibilityArrayAttributeCount:", :"accessibilityArrayAttributeValues:index:maxCount:", :"accessibilityAttributeValue:forParameter:", :"accessibilityDecodeOverriddenAttributes:", :"accessibilityEncodeOverriddenAttributes:", :"accessibilityIndexOfChild:", :accessibilityOverriddenAttributes, :accessibilityParameterizedAttributeNames, :"accessibilitySetOverrideValue:forAttribute:", :accessibilityShouldUseUniqueId, :accessibilitySupportsOverriddenAttributes, :"addObject:toBothSidesOfRelationshipWithKey:", :"addObject:toPropertyWithKey:", :"addObserver:forKeyPath:options:context:", :allPropertyKeys, :attributeKeys, :"awakeAfterUsingCoder:", :"bind:toObject:withKeyPath:options:", :"childWithClass:code:keyForm:keyData:", :"childWithClass:code:keyForm:keyData:length:type:", :"childWithClass:code:keyForm:keyData:type:", :"childWithClass:code:keyForm:keyDesc:", :class, :classCode, :classDescription, :"classDescriptionForDestinationKey:", :classForArchiver, :classForCoder, :classForKeyedArchiver, :classForPortCoder, :className, :clearProperties, :clone, :close, :"coerceValue:forKey:", :"coerceValueForScriptingProperties:", :"conformsToProtocol:", :container, :context, :copy, :"copyScriptingValue:forKey:withProperties:", :"createKeyValueBindingForKey:typeMask:", :data, :debugDescription, :define_singleton_method, :delete, :description, :"descriptionForSpecifier:", :"dictionaryWithValuesForKeys:", :"didChange:valuesAtIndexes:forKey:", :"didChangeValueForKey:", :"didChangeValueForKey:withSetMutation:usingObjects:", :display, :"doesContain:", :"doesNotRecognizeSelector:", :downloaded, :dup, :"duplicateTo:", :"elementArrayWithCode:", :"elementWithCode:ID:", :"elementWithCode:atIndex:", :"elementWithCode:named:", :"encodeWithCoder:", :entityName, :enum_for, :eql?, :equal?, :"equal?:", :exists, :exposedBindings, :extend, :finalize, :flushKeyBindings, :format, :"forwardInvocation:", :"forwardingTargetForSelector:", :freeze, :frozen?, :gem, :get, :"handleQueryWithUnboundKey:", :"handleTakeValue:forUnboundKey:", :hash, :id, :"implementsSelector:", :"infoForBinding:", :init, :"initWithApplication:specifier:", :"initWithClass:properties:data:", :"initWithCoder:", :"initWithContext:specifier:", :"initWithData:", :"initWithElementCode:properties:data:", :"initWithProperties:", :"insertValue:atIndex:inPropertyWithKey:", :"insertValue:inPropertyWithKey:", :inspect, :instance_eval, :instance_exec, :instance_of?, :instance_variable_defined?, :instance_variable_get, :instance_variable_set, :instance_variables, :"inverseForRelationshipKey:", :"isCaseInsensitiveLike:", :"isEqual:", :"isEqualTo:", :isFault, :"isGreaterThan:", :"isGreaterThanOrEqualTo:", :"isKindOfClass:", :"isLessThan:", :"isLessThanOrEqualTo:", :"isLike:", :"isMemberOfClass:", :isNSArray__, :isNSData__, :isNSDate__, :isNSDictionary__, :isNSNumber__, :isNSSet__, :isNSString__, :isNSValue__, :"isNotEqualTo:", :isProxy, :isRangeSpecifier, :"isToManyKey:", :is_a?, :"keyValueBindingForKey:typeMask:", :kind, :kind_of?, :method, :"methodDescriptionForSelector:", :"methodForSelector:", :"methodSignatureForSelector:", :methods, :"mutableArrayValueForKey:", :"mutableArrayValueForKeyPath:", :mutableCopy, :"mutableSetValueForKey:", :"mutableSetValueForKeyPath:", :name, :"newScriptingObjectOfClass:forValueForKey:withContentsValue:properties:", :"nextSlicePiece:", :nil?, :objectSpecifier, :object_id, :observationInfo, :"observeValueForKeyPath:ofObject:change:context:", :open, :"optionDescriptionsForBinding:", :"ownsDestinationObjectsForRelationshipKey:", :"performSelector:", :"performSelector:object:afterDelay:", :"performSelector:onThread:withObject:waitUntilDone:", :"performSelector:onThread:withObject:waitUntilDone:modes:", :"performSelector:withObject:", :"performSelector:withObject:afterDelay:", :"performSelector:withObject:afterDelay:inModes:", :"performSelector:withObject:withObject:", :"performSelectorInBackground:withObject:", :"performSelectorOnMainThread:withObject:waitUntilDone:", :"performSelectorOnMainThread:withObject:waitUntilDone:modes:", :persistentID, :"playOnce:", :positionAfter, :positionBefore, :"printPrintDialog:withProperties:kind:theme:", :private_methods, :"propertyWithClass:code:", :"propertyWithCode:", :protected_methods, :public_method, :public_methods, :public_send, :qualifiedSpecifier, :"qualify:", :"removeObject:fromBothSidesOfRelationshipWithKey:", :"removeObject:fromPropertyWithKey:", :"removeObserver:forKeyPath:", :"removeValueAtIndex:fromPropertyWithKey:", :"replaceValueAtIndex:inPropertyWithKey:withValue:", :"replacementObjectForArchiver:", :"replacementObjectForCoder:", :"replacementObjectForKeyedArchiver:", :"replacementObjectForPortCoder:", :respond_to?, :"respondsToSelector:", :reveal, :scriptingProperties, :"scriptingValueForSpecifier:", :self, :send, :"sendEvent:id:format:", :"sendEvent:id:parameters:", :"setData:", :"setKind:", :"setName:", :"setNilValueForKey:", :"setObservationInfo:", :"setScriptingProperties:", :"setTo:", :"setValue:forKey:", :"setValue:forKeyPath:", :"setValue:forUndefinedKey:", :"setValuesForKeysWithDictionary:", :singleton_methods, :specifier, :specifierDescription, :"storedValueForKey:", :superclass, :taint, :tainted?, :"takeStoredValue:forKey:", :"takeStoredValuesFromDictionary:", :"takeValue:forKey:", :"takeValue:forKeyPath:", :"takeValuesFromDictionary:", :tap, :toManyRelationshipKeys, :toOneRelationshipKeys, :to_enum, :to_s, :"unableToSetNilForKey:", :"unbind:", :untaint, :"validateTakeValue:forKeyPath:", :"validateValue:forKey:", :"validateValue:forKey:error:", :"validateValue:forKeyPath:error:", :"valueAtIndex:inPropertyWithKey:", :"valueClassForBinding:", :"valueForKey:", :"valueForKeyPath:", :"valueForUndefinedKey:", :"valueWithName:inPropertyWithKey:", :"valueWithUniqueID:inPropertyWithKey:", :"valuesForKeys:", :"willChange:valuesAtIndexes:forKey:", :"willChangeValueForKey:", :"willChangeValueForKey:withSetMutation:usingObjects:", :zone]

Change History

Changed 9 months ago by lsansonetti@…

  • milestone set to MacRuby 1.0

Changed 9 months ago by lsansonetti@…

I have been looking at fixing this bug in the afternoon, for the 0.1 release, but it couldn't find a way to fix it without dramatically impacting the performances, and it's still subject to a few regressions.

This bug should disappear once we will use the ObjC dispatcher for everything.

In the meantime I registered a test case (which is at the moment failing).

Changed 6 months ago by lsansonetti@…

  • milestone changed from MacRuby 1.0 to MacRuby 0.3

Changed 3 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed

Fixed in trunk.

$ macirb

framework 'ScriptingBridge'

=> true

app = SBApplication.applicationWithBundleIdentifier('com.apple.iTunes')

=> #<ITunesApplication:0x312cef0>

app.currentTrack.artworks[0].format.description

=> "<NSAppleEventDescriptor: 'PNG '>" }}}

Note: See TracTickets for help on using tickets.