• Das kreative Thema des Monats Oktober wird vor allem diejenigen unter Euch besonders ansprechen, denen Do-it-yourself quasi im Blut liegt. Zeigt uns Eure Improvisationskünste oder fotografiert, was andere Leute sich so im Alltag zusammengestrickt haben. --> Zum Mitmachen bitte hier klicken

Kopie von Webseite in FileMaker speichern

since1984

Erdapfel
Registriert
29.04.15
Beiträge
3
Hallo Allerseits!

Ich brauche den Inhalt einer Webseite, der "im Handbetrieb" durch CMD-C erzeugt wird (nicht Source, nicht Text). Dieser Inhalt der Zwischenablage soll dann in ein FileMaker-Feld abgelegt werden.

Folgendes Script funktioniert nicht richtig, auch der Teil in den System Events ...

tell application "Safari"
activate

tell application "System Events"
keystroke "a" using command down
delay 1
keystroke "c" using command down
end tell

end
tell

tell application "FileMaker Pro Advanced"
activate
show layout "xyz" of database "abc.fmp12"
set data cell "WebKopie" to the clipboard
end
tell

Wer kann helfen? Vielen Dank im Voraus!

Herzliche Grüße
since1984
 
Für den Fall, dass das noch aktuell sein sollte:

Ich habe leider kein Filemaker, mit einem TextEdit Dokument würde das aber so funktionieren:

Code:
tell application "Safari"
    -- Safari in den Vordergrund
    activate
    -- Warten bis Safari im Vordergrund ist
    repeat until frontmost is true
        delay 0.1
    end repeat
end tell
tell application "System Events"
    tell process "Safari"
        -- Alles markieren
        keystroke "a" using command down
        -- Alles kopieren
        keystroke "c" using command down
    end tell
end tell


tell application "TextEdit"
    activate
    repeat until frontmost is true
        delay 0.1
    end repeat
end tell
tell application "System Events"
    tell process "TextEdit"
        -- Alles einfügen
        keystroke "v" using command down
    end tell
end tell
 
  • Like
Reaktionen: since1984
Hallo Pill,

Dein Tipp hat funktioniert - vielen Dank. Diese "Repeat..."-Geschichte ist sehr sinnvoll, wieder etwas dazugelernt.

Viele Grüße
since1984