Re: Hyperlink auf externes Dokument
Lutz-Dieter Bornemann <[email protected]> Wed, 11 Jun 2014 09:30:36 +0200
| Newsgroups | gmane.os.apple.ragtime.german |
|---|---|
| Message-ID | <[email protected]> |
Guten Tag Allerseits,
ich arbeite seit geraumer Zeit mit folgendem Script,
um mir für die Erstellung von Links von einem RT-Dokument
zu anderen Dateien die Arbeit zu erleichtern.
Zuvor noch 4 Hinweise:
1. Ich arbeite mit OS 10.6.8 und RT 6.5.2.
2. Wegen des GUI-Scriptings muss das Script
außerhalb von RT gestartet werden.
Einbau innerhalb von RT bringt also nichts.
Außerdem muss unter Systemeinstellungen – Bedienungshilfen – Maus & Trackpad
"Zugriff auf Hilfsgeräte aktivieren" angehakt sein.
3. Wer unter Systemeinstellungen – Tastatur – Tastaturbefehle
den Radio-Button für "Alle Steuerungen" als Voreinstellung
ausgewählt hat, muss unter Umständen die Zeile:
"keystroke tab -- Tabulatortaste"
um ein oder zwei weitere "keystroke tab -- Tabulatortaste"-Zeilen ergänzen.
4. Die Zeile "set theLink to POSIX path of file ((choose file) as text)"
ruft unter anderem einen Dialog auf, der es erlaubt,
das Dokument auszuwählen, auf das man verlinken möchte.
Gruß
Lutz
tell application "RagTime 6.5"
activate
try
if length of (selection as text) < 2 then
error
end if
on error
display dialog "Markieren Sie zuvor im RT-Dokument mindestens 2 Zeichen!" with icon 0 buttons {"Weiter"} default button 1 cancel button 1
end try
tell application "System Events" -- Beginn von GUI-Scripting
tell process "RagTime"
click menu item "Als Verknüpfung markieren" of menu 1 of menu bar item "Extras" of menu bar 1
delay 0.2 -- kann man u. U. auch weglassen
keystroke "H"
click radio button "URL" of window 1
delay 0.2 -- kann man u. U. auch weglassen
keystroke tab -- Tabulatortaste
end tell
end tell -- Ende von GUI-Scripting
set theLink to POSIX path of file ((choose file) as text)
set theLink to "file://" & theLink
set selection to theLink
tell application "System Events" -- Beginn von GUI-Scripting
tell process "RagTime"
click button "OK" of window 1
end tell
end tell -- Ende von GUI-Scripting
end tell
Am 11.06.2014 um 08:36 schrieb Thomas Kaegi:
> Hallo Norbert
>
> Super! Das ist aber meines Wissens nirgends dokumentiert. Für Andreas könnte dies die Lösung sein.
>
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[email protected]>.
To unsubscribe, E-mail to: <[email protected]>
To switch to the DIGEST mode, E-mail to <[email protected]>
To switch to the INDEX mode, E-mail to <[email protected]>
Send administrative queries to <[email protected]>