[GastForen

  • Suche
  • Hilfe
  • Lesezeichen
  • Benutzerliste
Forenindex -- Lesezeichen

3 Lesezeichen für applescript

ewiges Thema: Drucken aus Quark 7
Antwort auf [ Robert Zacherl ] Hallo Herr Ablinger,

wir müssen da kein Geheimnis daraus machen.

Mein Scriptinhalt sieht folgendermassen aus:

#!/bin/bash
sudo -k
echo "<IHR ADMIN PASSWORT>" | sudo -S chmod 711 /Private/var/spool/cups
sudo -k

Diesen Text pasten Sie in eine Textdatei, speichern diese und machen Sie im Terminal ausführbar, indem Sie ein Terminalfenster öffnen, folgendes eintippen

chmod 710

(Leerzeichen hinter "710" nicht vergessen) und die Textdatei per Drag & Drop ins Terminal-Fenster ziehen.

Nun können Sie die ausführbare Scriptdatei in der Mac OS X Benutzerverwaltung als Startobjekt angeben.


Hallo Herr Zacherl,

nach einigem Hin und Her habe ich ein sicheres Skript für diesen Workaround entwickelt, der ohne Terminal etc. auskommt - in dem Wissen, dass Ihr Ansatz derzeit das einzig wahre Debug ist; dazu muss man einfach einen neuen Schlüssel "Manfred" im Schlüsselbund mit admin-Nutzer und admin-passwort anlegen. Anschließend folgendes Skript als ausführbares Programm speichern und in Systemeinstellungen->Benutzer->Startobjekte definieren. (Beim ersten Neustart fragt Schlüsselbund mehrmals um Erlaubnis, danach ist OK.)

Das Skript also lautet (bis auf Manfred – Manfred durch eigenen Dateinamen im Schlüsselbund ersetzen):
tell application "Keychain Scripting"
set theKey to first key of current keychain ¬
whose name is "Manfred"
set theUser to account of theKey
set thePassword to password of theKey
end tell
do shell script ¬
"chmod 711 /private/var/spool/cups" user name theUser password thePassword ¬
with administrator privileges

In der Hoffnung, dies möge zusätzlich helfen,

rakader
...
rakader
9. Mär 2007, 05:08
eingebettetes Profil anderen Bildern zuweisen
Hallo,

dafür bietet MacOS X zwei Skripts.
Liegen in Library->Skripts->ColorSync
Zuerst machst du "Extract Profile", dann hast du das eingebettete Profil als Datei.
Dann "embed chosen profile" zum taggen der anderen Bilder.
...
loethelm
3. Jul 2007, 09:20
Tabellenbreite proportional skalieren
Das Script habe ich grade für eine (eigentlich unsympatische) Anfrage im englischen Forum erstellt.
War eh halb fertig ;)
Ich, nicht das Script.
Das war dreiviertelfertig.
Jetzt ist es ganz fertig.

Also dachte ich, hier hat vielleicht auch einer Freude daran:
Es rechnet die Breite einer Tabelle aus (ohne Konturen am Rand) und zeigt diese in einem Dialog an, so dass ich eine neue Breite eingeben kann. Alle Spalten werden dann proportional verbreitert oder -schmälert, um die neue Breite zu erreichen.

Code
tell application "Adobe InDesign CS3" 
set ms to selection
set aTable to parent of item 1 of ms
if class of aTable ? table then
set aTable to parent of aTable
if class of aTable ? table then
display dialog "no table selected"
return
end if
end if

set nC to count columns in aTable
set tWidth to 0.0
repeat with n from 1 to nC
set aWidth to (width of (column n of aTable))
set tWidth to tWidth + aWidth
end repeat

set myDialog to make dialog with properties {name:"Set Width of Table"}
tell myDialog
make dialog column
tell the result
set tNuWidth to make measurement editbox with properties {edit value:(tWidth * 2.83465), edit units:millimeters}
end tell
end tell
set nu to show myDialog
if nu is true then
set nuWidth to (edit value of tNuWidth) * 0.35278
set scaleClm to nuWidth / tWidth
repeat with n from 1 to nC
set aWidth to (width of (column n of aTable))
set width of column n of aTable to (scaleClm * aWidth)
end repeat
else
destroy myDialog
return
end if
end tell

...
Gerald Singelmann
11. Sep 2007, 19:13