rb-appscript 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +17 -0
- data/README +1 -1
- data/TODO +0 -4
- data/doc/appscript-manual/01_introduction.html +3 -2
- data/doc/appscript-manual/02_aboutappscripting.html +4 -4
- data/doc/appscript-manual/03_quicktutorial.html +14 -12
- data/doc/appscript-manual/04_gettinghelp.html +1 -1
- data/doc/appscript-manual/06_classesandenums.html +3 -3
- data/doc/appscript-manual/07_applicationobjects.html +17 -16
- data/doc/appscript-manual/08_realvsgenericreferences.html +16 -16
- data/doc/appscript-manual/09_referenceforms.html +15 -15
- data/doc/appscript-manual/10_referenceexamples.html +28 -27
- data/doc/appscript-manual/11_applicationcommands.html +14 -14
- data/doc/appscript-manual/12_commandexamples.html +14 -14
- data/doc/appscript-manual/13_performanceissues.html +8 -5
- data/doc/appscript-manual/14_problemapps.html +4 -5
- data/doc/mactypes-manual/index.html +27 -9
- data/doc/osax-manual/index.html +1 -1
- data/rb-appscript-0.2.0.gem +0 -0
- data/rb-appscript.gemspec +1 -1
- data/sample/AB_list_people_with_emails.rb +2 -1
- data/sample/Create_daily_iCal_todos.rb +4 -3
- data/sample/Hello_world.rb +2 -1
- data/sample/List_iTunes_playlist_names.rb +2 -1
- data/sample/Make_Mail_message.rb +2 -1
- data/sample/Open_file_in_TextEdit.rb +2 -1
- data/sample/Organize_Mail_messages.rb +3 -2
- data/sample/Print_folder_tree.rb +2 -1
- data/sample/Select_all_HTML_files.rb +3 -2
- data/sample/Set_iChat_status.rb +4 -3
- data/sample/Simple_Finder_GUI_Scripting.rb +3 -2
- data/sample/Stagger_Finder_windows.rb +2 -1
- data/sample/TextEdit_demo.rb +6 -5
- data/sample/iTunes_top40_to_html.rb +3 -2
- data/src/lib/_aem/mactypes.rb +24 -2
- data/src/lib/_appscript/referencerenderer.rb +7 -7
- data/src/lib/appscript.rb +32 -12
- data/src/lib/osax.rb +21 -19
- data/src/rbae.c +0 -12
- data/test/test_appscriptreference.rb +30 -30
- metadata +3 -2
data/src/rbae.c
CHANGED
@@ -436,17 +436,6 @@ rbAE_launchApplication(VALUE self, VALUE path, VALUE firstEvent, VALUE flags)
|
|
436
436
|
return rb_ary_new3(2, INT2NUM(psn.highLongOfPSN), INT2NUM(psn.lowLongOfPSN));
|
437
437
|
}
|
438
438
|
|
439
|
-
static VALUE
|
440
|
-
rbAE_pidToPsn(VALUE self, VALUE pid) // TO DO: not currently used by aem/appscript; delete?
|
441
|
-
{
|
442
|
-
OSStatus err = 0;
|
443
|
-
ProcessSerialNumber psn;
|
444
|
-
|
445
|
-
err = GetProcessForPID((pid_t)NUM2INT(pid), &psn);
|
446
|
-
if (err != noErr) rbAE_raiseMacOSError("Can't convert PID to PSN.", err);
|
447
|
-
return rb_ary_new3(2, INT2NUM(psn.highLongOfPSN), INT2NUM(psn.lowLongOfPSN));
|
448
|
-
}
|
449
|
-
|
450
439
|
/**********************************************************************/
|
451
440
|
// Date conversion
|
452
441
|
|
@@ -737,7 +726,6 @@ Init_ae (void)
|
|
737
726
|
rb_define_module_function(mAE, "find_application", rbAE_findApplication, 3);
|
738
727
|
rb_define_module_function(mAE, "psn_for_application_path", rbAE_psnForApplicationPath, 1);
|
739
728
|
rb_define_module_function(mAE, "launch_application", rbAE_launchApplication, 3);
|
740
|
-
rb_define_module_function(mAE, "pid_to_psn", rbAE_pidToPsn, 1);
|
741
729
|
|
742
730
|
rb_define_module_function(mAE, "convert_long_date_time_to_unix_seconds",
|
743
731
|
rbAE_convertLongDateTimeToUnixSeconds, 1);
|
@@ -7,7 +7,7 @@ require "appscript"
|
|
7
7
|
class TC_AppscriptReferences < Test::Unit::TestCase
|
8
8
|
|
9
9
|
def setup
|
10
|
-
@te =
|
10
|
+
@te = Appscript.app('TextEdit')
|
11
11
|
@s = @te.to_s
|
12
12
|
end
|
13
13
|
|
@@ -34,53 +34,53 @@ class TC_AppscriptReferences < Test::Unit::TestCase
|
|
34
34
|
[@te.documents.last, @s+'.documents.last', nil],
|
35
35
|
[@te.documents.any, @s+'.documents.any', nil],
|
36
36
|
|
37
|
-
[
|
37
|
+
[Appscript.con.documents[3], 'con.documents[3]', nil],
|
38
38
|
|
39
39
|
[@te.documents[
|
40
|
-
|
41
|
-
|
40
|
+
Appscript.con.documents[3],
|
41
|
+
Appscript.con.documents['foo']],
|
42
42
|
@s+'.documents[' +
|
43
|
-
'
|
44
|
-
'
|
43
|
+
'con.documents[3], ' +
|
44
|
+
'con.documents["foo"]]', nil],
|
45
45
|
|
46
46
|
|
47
|
-
[
|
48
|
-
'
|
47
|
+
[Appscript.its.name.eq('foo').and(Appscript.its.words.eq([])),
|
48
|
+
'its.name.eq("foo").and(its.words.eq([]))', nil],
|
49
49
|
|
50
|
-
[
|
51
|
-
'
|
52
|
-
|
50
|
+
[Appscript.its.words.ne([]),
|
51
|
+
'its.words.ne([])',
|
52
|
+
Appscript.its.words.eq([]).not], # i.e. there isn't a KAENotEqual operator, so not-equal tests are actually packed as an equal test followed by not test
|
53
53
|
|
54
|
-
[
|
55
|
-
[
|
56
|
-
'
|
57
|
-
[
|
58
|
-
[
|
59
|
-
'
|
54
|
+
[Appscript.its.words.eq(nil), 'its.words.eq(nil)', nil],
|
55
|
+
[Appscript.its.words.size.gt(0),
|
56
|
+
'its.words.size.gt(0)', nil],
|
57
|
+
[Appscript.its.words.le(''), 'its.words.le("")', nil],
|
58
|
+
[Appscript.its.words.starts_with('foo').not,
|
59
|
+
'its.words.starts_with("foo").not', nil],
|
60
60
|
|
61
61
|
|
62
|
-
[
|
63
|
-
[
|
62
|
+
[Appscript.its.words.contains('foo'), 'its.words.contains("foo")', nil],
|
63
|
+
[Appscript.its.words.is_in('foo'), 'its.words.is_in("foo")', nil],
|
64
64
|
|
65
|
-
[@te.documents[
|
66
|
-
@s+'.documents[
|
65
|
+
[@te.documents[Appscript.its.size.ge(42)],
|
66
|
+
@s+'.documents[its.size.ge(42)]', nil],
|
67
67
|
|
68
68
|
[@te.documents[1, 'foo'],
|
69
|
-
@s+'.documents[
|
70
|
-
@te.documents[
|
69
|
+
@s+'.documents[con.documents[1], con.documents["foo"]]',
|
70
|
+
@te.documents[Appscript.con.documents[1], Appscript.con.documents['foo']]],
|
71
71
|
|
72
72
|
[@te.documents[1].text \
|
73
73
|
.paragraphs.characters[
|
74
|
-
|
75
|
-
|
74
|
+
Appscript.con.characters[3],
|
75
|
+
Appscript.con.characters[55]
|
76
76
|
].next(:character).after,
|
77
77
|
@s+'.documents[1].text.paragraphs.characters' +
|
78
|
-
'[
|
78
|
+
'[con.characters[3], con.characters[55]]' +
|
79
79
|
'.next(:character).after', nil],
|
80
80
|
|
81
|
-
[
|
82
|
-
'
|
83
|
-
|
81
|
+
[Appscript.its.name.ne('foo').and(Appscript.its.words.eq([])).not,
|
82
|
+
'its.name.ne("foo").and(its.words.eq([])).not',
|
83
|
+
Appscript.its.name.eq('foo').not.and(Appscript.its.words.eq([])).not],
|
84
84
|
|
85
85
|
[@te.documents.start, @s+'.documents.start', nil],
|
86
86
|
[@te.documents.end, @s+'.documents.end', nil],
|
@@ -92,7 +92,7 @@ class TC_AppscriptReferences < Test::Unit::TestCase
|
|
92
92
|
d = @te.AS_app_data.pack(val)
|
93
93
|
val = unpacked_version ? unpacked_version : val
|
94
94
|
val2 = @te.AS_app_data.unpack(d)
|
95
|
-
if val.class == @te.AS_app_data.unpack(d).class # note:
|
95
|
+
if val.class == @te.AS_app_data.unpack(d).class # note: Appscript::Reference and Appscript::GenericReference currently aren't comparable with each other, so the next test would always fail for those
|
96
96
|
assert_equal(val, val2)
|
97
97
|
assert_block { val.eql?(val2) }
|
98
98
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rb-appscript
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date: 2006-11-
|
6
|
+
version: 0.2.1
|
7
|
+
date: 2006-11-30 00:00:00 +00:00
|
8
8
|
summary: Ruby appscript (rb-appscript) is a high-level, user-friendly Apple event bridge that allows you to control scriptable Mac OS X applications using ordinary Ruby scripts.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- extconf.rb
|
35
35
|
- LICENSE
|
36
36
|
- misc
|
37
|
+
- rb-appscript-0.2.0.gem
|
37
38
|
- rb-appscript.gemspec
|
38
39
|
- README
|
39
40
|
- sample
|