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: Help required with Shell Script please.



On 03/30/07, Nick Hearn <email@hidden> wrote:
>
> Please can someone help me. I'm trying to get a list of the names of
> custom print presets from this plist file
> 'com.apple.print.custompresets.plist'.
>
> If I run this script:-
>
>            do shell script "defaults read com.apple.print.customPresets"
>
> part of what I get back is this :-
>
> \"com.apple.print.customPresetNames\" = (\"a4 duplex\", test1, test2);
>
> I've been trying a number of different ways to access just the preset
> names i.e. a4 duplex, test1, test2.
> I'd like to be able to get these into a list so I can present them to
> the user and they can select which preset they require.
>
> I've trawled through a number of articles and pages of info however,
> as yet I've still not come up with a solution.
> I feel I'm very close but I'm not sure how to achieve this task.
>
> Any help would be much appreciated.

Try:

do shell script "defaults read com.apple.print.customPresets
com.apple.print.customPresetNames"

On my machine (10.4.9), with only one presetName, returns:

("Standard 1")
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to 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.