Comments (8)
The actual identifier is com.apple.finder, why should it be case insensitive?
from axelements.
As com.apple.Finder still works but causes a RuntimeError when it should just fail as not found.
from axelements.
The issue is that NSWorkspace.launchAppWithBundleIdentifier
is case-insensitive, but NSRunningApplication.runningApplicationsWithBundleIdentifier
is case-sensitive.
The problem then is that "com.apple.Finder"
will not be found as a running application, so we try to launch it, which then brings Finder to the front (because it is already running). Then we sleep on the run loop for a couple of seconds and try again.
After looping a few times we raise an exception.
I think this might actually be an Apple problem...something to report to them. I just need to double check what I've claimed here first...
from axelements.
Hey, we all make mistakes.....right?
Let me know then and I'll direct my gaze over to radar.
from axelements.
Another example
1.9.3-p362 :003 > apple_contacts = AX::Application.new "com.apple.addressbook"
RuntimeError: com.apple.addressbook failed to launch in time
from /Users/mp4976qpa/Developer/AXElements/lib/accessibility/dsl.rb:136:in raise' from /Users/mp4976qpa/Developer/AXElements/lib/ax/application.rb:134:in
initialize'
from (irb):3:in new' from (irb):3 from /Users/mp4976qpa/.rvm/rubies/ruby-1.9.3-p362/bin/irb:16:in
1.9.3-p362 :004 > apple_contacts = AX::Application.new "com.apple.AddressBook"
=> #<AX::Application "Contacts" 2 children focused[✘] pid=30451>
1.9.3-p362 :005 >
1.9.3-p362 :006 > apple_contacts = AX::Application.new "com.apple.stupid"
RuntimeError: com.apple.stupid is not a registered bundle identifier for the system
from /Users/mp4976qpa/Developer/AXElements/lib/accessibility/dsl.rb:136:in
raise' from /Users/mp4976qpa/Developer/AXElements/lib/ax/application.rb:136:in
initialize'from (irb):6:in
new' from (irb):6 from /Users/mp4976qpa/.rvm/rubies/ruby-1.9.3-p362/bin/irb:16:in
'from axelements.
Here again, it's case sensitive. The identifier actually is com.apple.AddressBook. Probably it's best if you check the Info.plist of the application.
from axelements.
Hmmm, that might have to be the work around for now. Fortunately, there are a few ways to easily get the bundle identifier for an application. Here's a non-exhaustive list of ways you can do it from within Ruby (with AXElements):
1: If the app is already running
AX::Application.new('Contacts').bundle_identifier
2: If you know where the app is:
load_plist(File.read('/Applications/Contacts.app/Contents/Info.plist'))['CFBundleIdentifier']
from axelements.
Thank-you, appreciated.
from axelements.
Related Issues (20)
- Graph needs sanity tests
- Fix setup_dev rake task
- Inspecting an unready element often raises an exception
- wait_for should be the implicit behaviour for all searching
- Mountain Lion support HOT 1
- Adjust Core according to what we learned at WWDC HOT 1
- Parallelize processing of array attributes HOT 1
- Add statistics tracking for Core HOT 2
- MacRuby crash on bad elements HOT 1
- Finish implementing Accessibility::Graph
- Mouse safety
- Move project to be under the AXElements organization HOT 1
- Make most/all DSL methods work in an OO way
- Remove test:cruby task HOT 1
- RuntimeError when trying to login and change views HOT 3
- Needs mouse to support individual events for right_click_down and right_click_up HOT 1
- DSL#select_menu_item for all menus
- Unable to access controls due to QTMovie Viewer control. HOT 1
- AXElements on Mac OS X 10.9 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axelements.