Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: widget.system Function



On Jun 23, 2006, at 12:04 PM, Jesse Almanrode - JA Computing wrote:

here a way in _javascript_ to evaluate this string and remove the
"/n" from the string returned in the widget.system call? I am sure
that there is some way to do it but I just cannot think of it off the
top of my head!

I don't know of a built-in function for this, but it's easy to do with regular expressions. In your case, commandLoc.replace(/\n?$/, "") ought to do it. Or in general (untested):

function chomp(str)
{
str.replace(/\r?\n?$/, ""); // classic Mac, Unix, or DOS endlines
}

-- 
Mike Blaguszewski / Cocoa Hacker / Ambrosia Software, Inc.



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden

References: 
 >widget.system Function (From: "Jesse Almanrode - JA Computing" <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.