Jump to content

Applescript reorganize workspace


Recommended Posts


I'm daily changing screens due to using external displays and projectors of several sizes for demo and training reasons.

I've been using an applescript to re-organize my screen setup in VW 12 - 2009. Now in VW2010 the windows 'Navigation - Classes' and 'Visualisation - Lights' don't understand the 'Set Bounds of window' command. I guess this is due to the naming which contains a '-'.

Does anyone have a solution for this little inconvenience?

Here's the applescript:

tell current application

set theApplication to "VectorWorks 2010 US"

end tell

-- Get the screen bounds of your active display

tell application "Finder"

set theScreenSize to bounds of window of desktop

set theScreenWidth to item 3 of theScreenSize

set theScreenHeigth to item 4 of theScreenSize

if theScreenWidth > 1920 then set theScreenWidth to 1920

if theScreenHeigth > 1200 then set theScreenHeigth to 1200

end tell

-- Reposition your VectorWorks elements

tell application theApplication


set theBasic to "Basic"

set theTools to "Tool Sets"

set theNavigation to "Navigation - Classes"

set theRessources to "Resource Browser"

set theInfo to "Obj Info"

set theVisual to "Visualization - Lights"

set bounds of window theBasic to {0, 22 + 16, 156, 255}

set thePositionList to bounds of window theBasic as list

set theBottom to item 4 of thePositionList

set bounds of window theTools to {0, theBottom + 16, 156, theScreenHeigth - 4}

-- set theTest to visible of window theNavigation

set theTest to false

if theTest then

set theBottom to theScreenHeigth * 0.6 as integer


set theBottom to theScreenHeigth - 4

end if

if theScreenWidth < 1500 then

set theRightPaletWidth to theScreenWidth / 5 as integer


set theRightPaletWidth to 300

end if


set bounds of window theInfo to {theScreenWidth - theRightPaletWidth, 22 + 16, theScreenWidth, theBottom}

end try


set bounds of window theNavigation to {theScreenWidth - theRightPaletWidth, (theScreenHeigth * 0.6 + 16) as integer, theScreenWidth, theScreenHeigth - 4}

end try


set bounds of window theRessources to {theScreenWidth - theRightPaletWidth - theRightPaletWidth - 40, 200, theScreenWidth - theRightPaletWidth - 40, theScreenHeigth - 150}

end try


set bounds of window theVisual to {179, 330, 179 + theRightPaletWidth, theScreenHeigth - 150}

end try


set bounds of window 1 to {156, 22 + 18, theScreenWidth - theRightPaletWidth, theScreenHeigth - 4}

end try

end tell

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...