Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How to read .plist files from Java
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to read .plist files from Java



Hi Doug and Greg,

I was trying very basic applescripts, for example:

 tell application "System Events"
 	set loginItemList to (name of every login item)
 end tell
 repeat with loginItem in loginItemList
 	write name of loginItem to stdout
 end repeat

show the error "variable stdout is not defined" at execution time. And

 tell application "System Events"
 	set loginItemList to (name of every login item)
 end tell
 repeat with loginItem in loginItemList
 	display dialog (name of loginItem & hidden of loginItem)
 end repeat

shows on my 10.5.3 system a compilation error "Can't get hidden of loginItem. Access not allowed."

I didn't mean to imply there is an object or class named "stdout"
available to AppleScripts.

I've found some scripts which were using stdout, hence I've tried to use it.

Have you considered a Launch Agent?

Now, I have no clue what it is.

We don't know what kind of app yours is, so we have no way to tell if its
behavior is more like Preview, more like TextEdit, more like System
Preferences, or more like <insert name here>.

Our application is SmartSVN, an SVN client. With the new version it has an Finder integration (context menu), so it makes sense to use it without showing a window. Hence our wish for the autostart feature.


--
Cheers,
Tom



Greg Guerin wrote:
Thomas Singer wrote:

I've tried to write the login item names to stdout.

Did you write an AppleScript, or did you write a Java program , or did you write a shell script?

I'm trying to understand the context where the error message "variable
'stdout' not defined" appears, and I don't know which of the 3
possibilities I listed you're talking about, or whether it's a combination:
Java exec'ing an AppleScript, Java exec'ing a shell script, Java exec'ing a
single 'osascript' command, etc.

When I used the term "stdout" before, I simply meant "the standard output
stream".  I didn't mean to imply there is an object or class named "stdout"
available to AppleScripts.  I didn't even mean to imply that you should
write an actual AppleScript module: an osascript command-line is all I
intended.


It is not perfect, but better than starting our application with windows
at login.

Have you considered a Launch Agent?


BTW, the Preview application behaves the same, it does not show any window
at all when started.

That's because Preview is a read-only viewer. If you don't give it any documents you want to view, it makes sense for it to not show any windows, document-windows or otherwise.

We don't know what kind of app yours is, so we have no way to tell if its
behavior is more like Preview, more like TextEdit, more like System
Preferences, or more like <insert name here>.

  -- GG


_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: How to read .plist files from Java (From: Greg Guerin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.