Class: OSAX::ScriptingAddition
Constant Summary
Appscript::Reference::DefaultConsiderations, Appscript::Reference::DefaultConsidersAndIgnores, Appscript::Reference::IgnoreEnums
AS_SafeObject::EXCLUDE
Instance Attribute Summary
#AS_aem_reference, #AS_app_data
Instance Method Summary
collapse
#==, #ID, #[], _pack_uint32, #_resolve_range_boundary, #_send_command, #after, #and, #any, #before, #beginning, #begins_with, #commands, #contains, #does_not_begin_with, #does_not_contain, #does_not_end_with, #elements, #end, #ends_with, #eq, #first, #ge, #gt, #hash, #help, #is_in, #is_not_in, #is_running?, #keywords, #last, #le, #lt, #methods, #middle, #ne, #next, #not, #or, #parameters, #previous, #properties, #respond_to?
hide
Constructor Details
Represents a single scripting addition.
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
|
# File 'lib/osax.rb', line 523
def initialize(name, terms=nil)
@_osax_name = name
if not terms
osax_name = name.downcase.sub(/(?i)\.osax$/, '')
OSAX._init_caches if OSAXCache == {}
path, terminology_tables = OSAXCache[osax_name]
if not path
raise ArgumentError, "Scripting addition not found: #{name.inspect}"
end
if not terminology_tables
sp = OSAX::SdefParser.new
sp.parse_file(path)
if osax_name == 'standardadditions'
OSAX::StandardAdditionsEnums.each { |o| sp.enumerators.push(o)}
end
terminology_tables = Terminology.tables_for_parsed_sdef(sp)
OSAXCache[osax_name][1] = terminology_tables
end
@_terms = terminology_tables
terms = OSAXData.new(:current, nil, @_terms)
elsif not terms.is_a?(OSAX::OSAXData)
terminology_tables = Terminology.tables_for_module(terms)
@_terms = terminology_tables
terms = OSAXData.new(:current, nil, @_terms)
end
super(terms, AEM.app)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
567
568
569
570
571
572
573
574
575
576
577
578
579
|
# File 'lib/osax.rb', line 567
def method_missing(name, *args)
begin
super
rescue Appscript::CommandError => e
if e.to_i == -1713
AE.transform_process_to_foreground_application
activate
super
else
raise
end
end
end
|
Instance Method Details
#by_aem_app(aem_app) ⇒ Object
612
613
614
615
|
# File 'lib/osax.rb', line 612
def by_aem_app(aem_app)
return ScriptingAddition.new(@_osax_name, OSAXData.new(:by_aem_app, aem_app, @_terms))
end
|
#by_creator(creator) ⇒ Object
596
597
598
599
600
|
# File 'lib/osax.rb', line 596
def by_creator(creator)
return ScriptingAddition.new(@_osax_name,
OSAXData.new(:by_path, FindApp.by_creator(creator), @_terms))
end
|
#by_id(id) ⇒ Object
590
591
592
593
594
|
# File 'lib/osax.rb', line 590
def by_id(id)
return ScriptingAddition.new(@_osax_name,
OSAXData.new(:by_path, FindApp.by_id(id), @_terms))
end
|
#by_name(name) ⇒ Object
A client-created scripting addition is automatically targetted at the current application. Clients can specify another application as target by calling one of the following methods:
584
585
586
587
588
|
# File 'lib/osax.rb', line 584
def by_name(name)
return ScriptingAddition.new(@_osax_name,
OSAXData.new(:by_path, FindApp.by_name(name), @_terms))
end
|
#by_pid(pid) ⇒ Object
602
603
604
605
|
# File 'lib/osax.rb', line 602
def by_pid(pid)
return ScriptingAddition.new(@_osax_name, OSAXData.new(:by_pid, pid, @_terms))
end
|
#by_url(url) ⇒ Object
607
608
609
610
|
# File 'lib/osax.rb', line 607
def by_url(url)
return ScriptingAddition.new(@_osax_name, OSAXData.new(:by_url, url, @_terms))
end
|
#current ⇒ Object
617
618
619
|
# File 'lib/osax.rb', line 617
def current
return ScriptingAddition.new(@_osax_name, OSAXData.new(:current, nil, @_terms))
end
|
#to_s ⇒ Object
Also known as:
inspect
559
560
561
|
# File 'lib/osax.rb', line 559
def to_s
return "#<OSAX::ScriptingAddition name=#{@_osax_name.inspect} target=#{@AS_app_data.target.inspect}>"
end
|