You are not logged in.
does anyone out there know if there is a way to give preview commands without driving the GUI like a service or can will it accept a command line ?
Preview.app is (a bit) scriptable, but you must enable it manually.
Open the Terminal and type (better copy ) this:
[code]defaults write /Applications/Preview.app/Contents/Info NSAppleScriptEnabled -bool YES[/code]
ok I ran that but I got back some stuff I've never seen before..... I take it this makes it so I can give it a command from terminal ?
hmm in either case I am unable to set that value to true as it doesn't seem to exist for that app
what I'm really trying to do is get preview to convert a PS to PDF as pstopdf makes a much llarger file than if I save the PS to PDF from Preview
what about through Xcode is there some way I can get that same result there ?
ok I ran that but I got back some stuff I've never seen before
I don't get any output from that command; Maybe we can help if you post that "stuff."
here it is
McGrail:~ mcgrail$ defaults write/Applications/Preview.app/Contents/Info NSAppleScripterEnabled -bool YES
Command line interface to a user's defaults.
'defaults' [-currentHost | -host <hostname>] followed by one of the following:
read shows all defaults
read <domain> shows defaults for given domain
read <domain> <key> shows defaults for given domain, key
read-type <domain> <key> shows the type for the given domain, key
write <domain> <domain_rep> writes domain (overwrites existing)
write <domain> <key> <value> writes key for domain
rename <domain> <old_key> <new_key> renames old_key to new_key
delete <domain> deletes domain
delete <domain> <key> deletes key in domain
domains lists all domains
find <word> lists all entries containing word
help print this help
<domain> is ( <domain_name> | -app <application_name> | -globalDomain )
or a path to a file omitting the '.plist' extension
<value> is one of:
-bool[ean] (true | false | yes | no)
-array <value1> <value2> ...
-array-add <value1> <value2> ...
-dict <key1> <value1> <key2> <value2> ...
-dict-add <key1> <value1> ...
I think you're missing a space after "write."
I opened the info.plist and its not there
Can you add it yourself?
no I don't have permission
I thought that would be the case. Unless you can use sudo, you'll have to find a different way to do what you want.
Side note: You typed "Scripter" instead of "Script"
Ok thank you all for your help ......
In 10.7 Info.plists are owned by root:
[code]sudo defaults write /Applications/Preview.app/Contents/Info NSAppleScriptEnabled -bool true
sudo chmod 644 /Applications/Preview.app/Contents/Info.plist
sudo codesign -f -s - /Applications/Preview.app[/code]
Now tell app "Preview" to windows shouldn't cause an error. As in 10.6, Preview still won't have a dictionary.
Last edited by l-ri (2011-08-04 07:50:28 pm)