I use iA Writer enough that I would like it to open in fullscreen on login, but unfortunately the developers have disdain for preferences.
I decided to write an AppleScript that I could add to the startup list, but I can't get it to work properly. I'd like to open a specific file using iA Writer on login, in 10.8 fullscreen mode, but without changing focus from my normal desktop, or a least automatically returning me to my primary desktop after launch. EDIT: Here is my code after suggested edits:
set front_application to front window
tell (application "iA Writer") to open (POSIX file "/PATH/TO/FILE.txt")
activate application "iA Writer"
#EDITED# tell application "System Events" to keystroke "f" using {command down, control down}
#ADDED# delay 1
#ADDED# tell application "System Events" to keystroke "1" using control down
end tell
activate front_application
This code successfully opens the file with iA Writer in fullscreen, but switches to the new, iA Writer-controlled desktop, waits a moment, and switches back to my main desktop.
Since OS X's change from spaces to desktops, I don't even know if it is even possible to open an application in Mountain/Lion fullscreen without it stealing focus and forcing a desktop switch.
Many thanks to @Lauri Ranta for your help thus far!
Any further help, regarding keeping iA Writer from switching desktops when becoming fullscreen, would be very appreciated. Thanks!