set fancyApps to {¬
{appBI:"com.apple.Terminal", sendCMDN:true, wPos:{1280 / 2, 0}, wSize:{1280 / 2, 800 / 2}}, ¬
{appBI:"com.apple.finder", sendCMDN:true, wPos:{1280 / 2, 800 / 2 + 17}, wSize:{1280 / 2, 800 / 2 - 17}}, ¬
{appBI:"org.gjt.sp.jedit", sendCMDN:false, wPos:{0, 0}, wSize:{1280 / 2, 800}} ¬
}
repeat with aApp in fancyApps
mvWin(appBI of aApp, sendCMDN of aApp, wPos of aApp, wSize of aApp)
end repeat
return
on mvWin(procBI, sendCMDN, wPos, wSize)
tell application "System Events"
repeat with i from 1 to 5
try
set aProc to (some process whose bundle identifier is procBI)
set the frontmost of aProc to true --bring to front
exit repeat
on error
--tell me to tell application procName to activate
tell me to do shell script "open -b " & procBI
delay 5
end try
end repeat
--check wincount
repeat until (count of windows of aProc) > 0
if (count of windows of aProc) < 1 then
tell aProc
set its frontmost to true
if sendCMDN then keystroke "n" using {command down}
end tell
end if
delay 0.5
end repeat
tell aProc
tell window 1 of aProc
set position to wPos
set size to wSize
end tell
end tell
end tell
end mvWin
tell application "Finder"
activate
try
close every Finder window
set x to make new Finder window to folder "Documents" of home
end try
set bounds of x to {640, 444, 1280, 844}
end tell
tell application "Terminal"
activate
set bounds of window 1 to {640, 0, 1280, 400}
end tell
set jEditBI to "org.gjt.sp.jedit"
do shell script "open -b " & jEditBI
delay 5
tell application "System Events"
set nRetry to 0
set wCount to 0
set jEProc to some process whose bundle identifier is jEditBI
repeat until wCount > 0 or nRetry = 10
set wCount to count of windows of jEProc
set nRetry to nRetry + 1
delay 2
end repeat
if nRetry = 10 then error "WTF! Klappt nicht mit jEdit"
tell window 1 of jEProc
set position to {0, 0}
set size to {1280 / 2, 800}
end tell
end tell
set fancyApps to {¬
{appBI:"com.apple.Terminal", sendCMDN:true, wPos:{1280 / 2, 0}, wSize:{1280 / 2, 800 / 2}}, ¬
{appBI:"com.apple.finder", sendCMDN:true, wPos:{1280 / 2, 800 / 2 + 17}, wSize:{1280 / 2, 800 / 2 - 17}}, ¬
{appBI:"org.gjt.sp.jedit", sendCMDN:false, wPos:{0, 0}, wSize:{1280 / 2, 800}} ¬
}
repeat with aApp in fancyApps
log logTime() & "info(me): calling mvwin with appBI:" & appBI of aApp & ", sendCMDN:" & sendCMDN of aApp & ", wPos:" & wPos of aApp & ", wSize" & wSize of aApp
mvWin(appBI of aApp, sendCMDN of aApp, wPos of aApp, wSize of aApp)
end repeat
return
on mvWin(procBI, sendCMDN, wPos, wSize)
tell application "System Events"
log my logTime() & "info(mvwin): starting 1st loop"
repeat with i from 1 to 5
try
set aProc to (some process whose bundle identifier is procBI)
log my logTime() & "info(mvwin): got process whose bi is " & procBI
set the frontmost of aProc to true --bring to front
exit repeat
on error
log my logTime() & "warn(mvwin): error getting process whose bi is " & procBI
--tell me to tell application procName to activate
log my logTime() & "info(mvwin): opening " & procBI
tell me to do shell script "open -b " & procBI
delay 5
end try
end repeat
log my logTime() & "info(mvwin): left 1st loop"
--check wincount
log my logTime() & "info(mvwin): starting 2nd loop"
repeat until (count of windows of aProc) > 0
if (count of windows of aProc) < 1 then
log my logTime() & "info(mvwin): wincount of aProc < 1"
tell aProc
set its frontmost to true
log my logTime() & "info(mvwin): set frontmost of aProc to true"
if sendCMDN then
keystroke "n" using {command down}
log my logTime() & "info(mvwin): send cmd+n to aProc"
end if
end tell
end if
delay 0.5
end repeat
log my logTime() & "info(mvwin): left 2nd loop"
log my logTime() & "info(mvwin): sizing & moving 1st window of aProc"
tell aProc
tell window 1 of aProc
log my logTime() & "info(mvwin): position: " & item 1 of wPos & ":" & item 2 of wPos
set position to wPos
log my logTime() & "info(mvwin): size: " & item 1 of wSize & ":" & item 2 of wSize
set size to wSize
end tell
end tell
end tell
end mvWin
on logTime()
return (hours of (current date) & ":" & minutes of (current date) & ":" & seconds of (current date) & space) as string
end logTime
tell app "system events"
set aProc to some process whose bundle identifier is "org.gjt.sp.jedit"
set wcount to count of windows of aProc
end
return wcount
Vergewissere dich doch mal in der Aktivitätsanzeige, dass jEdit auch wirklich beendet wurde und starte das Script erst dann nochmal, mehrmals*.Hmmm ich glaube ich war beim testen einfach nur zu schnell mit dem Schließen von jEdit.
Wir verwenden essentielle Cookies, damit diese Website funktioniert, und optionale Cookies, um den Komfort bei der Nutzung zu verbessern.
Für die Ihnen angezeigten Verarbeitungszwecke können Cookies, Geräte-Kennungen oder andere Informationen auf Ihrem Gerät gespeichert oder abgerufen werden.
Anzeigen und Inhalte können basierend auf einem Profil personalisiert werden. Es können mehr Daten hinzugefügt werden, um Anzeigen und Inhalte besser zu personalisieren. Die Performance von Anzeigen und Inhalten kann gemessen werden. Erkenntnisse über Zielgruppen, die die Anzeigen und Inhalte betrachtet haben, können abgeleitet werden. Daten können verwendet werden, um Benutzerfreundlichkeit, Systeme und Software aufzubauen oder zu verbessern.
Durch das Klicken des Buttons "Zustimmen" willigen Sie gem. Art. 49 Abs. 1 DSGVO ein, dass auch Anbieter in den USA Ihre Daten verarbeiten. In diesem Fall ist es möglich, dass die übermittelten Daten durch lokale Behörden verarbeitet werden.