Copy link to clipboard
Copied
Copy link to clipboard
Copied
//DESCRIPTION: Resets active window size or uses front window to set default size.Dave
// Check for WindowDefault.txt; if present use it to set front window
// if not, use front window to set it after checking with user.
myPath = app.activeScript;
myParts = myPath.toString().split("/");
myParts[(myParts.length - 1)] = "WindowDefault" + app.version.slice(0,1) + ".txt";
myNewPath = myParts.join("/");
mySettingsFile = File(myNewPath);
// Before proceeding, check that there is a front window
// If not, offer user the chance to delete the current settings
if (app.windows.length < 1) {
beep();
if (confirm("No window is open; would you like to delete the settings file?")) {
// User said yes; check that it exists
if(mySettingsFile.exists) {
mySettingsFile.remove();
}
}
} else {
if (mySettingsFile.open("r")) {
savedBounds = mySettingsFile.read();
mySettingsFile.close();
myBounds = savedBounds.split(",");
for (i = 0; i<myBounds.length; i++) {
myBounds = Number(myBounds);
}
app.windows[0].bounds = myBounds;
} else {
beep();
if (confirm("Settings file is missing. Use current front window to set default?")) {
// User said: go to it.
new File(mySettingsFile);
mySettingsFile.open("w");
mySettingsFile.write(app.windows[0].bounds);
mySettingsFile.close();
}
}
}
Copy link to clipboard
Copied
myPath = app.activeScript;Dave
mySettingsFile = File((myPath.parent) + "/WindowDefault" + app.version.slice(0,1) + ".txt");
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hello, Unfortunately, I am not understanding this at all. I don't know scripts. From the previous posts a while ago (which unfortunately don't work any more). I need to do some steps to rename/copy/paste the script so that my work area stays that size instead of going the whole width of the desktop and behind the palettes. But unfortunately, I don't understand what is being said here in these postings re. scripts.
Is there someway to get a script, change it's ending and then just put it somewhere in InDesign in CS4 and it will work. I understand that I also have to do another step of making sure something is not active any more (unchecking some box).
Thank you again for all your help.
Copy link to clipboard
Copied
My windows scripts don't work in Windows ;-( because in Windows you can't turn off the Application Frame and with that on, the script can't change the positioning of the windows.
So, before we go any further, can you confirm that you are a Mac user?
Dave
Copy link to clipboard
Copied
Yes, Mac. OS 10.5.x (I have to double check at home which OS). Thank you.
Copy link to clipboard
Copied
In that case, here again is the script I use:
//DESCRIPTION: Resets active window size or uses front window to set default size.
// Check for WindowDefault.txt; if present use it to set front window
// if not, use front window to set it after checking with user.
myPath = app.activeScript;
myParts = myPath.toString().split("/");
myParts[(myParts.length - 1)] = "WindowDefault" + app.version.slice(0,1) + ".txt";
myNewPath = myParts.join("/");
mySettingsFile = File(myNewPath);
// Before proceeding, check that there is a front window
// If not, offer user the chance to delete the current settings
if (app.windows.length < 1) {
beep();
if (confirm("No window is open; would you like to delete the settings file?")) {
// User said yes; check that it exists
if(mySettingsFile.exists) {
mySettingsFile.remove();
}
}
} else {
if (mySettingsFile.open("r")) {
savedBounds = mySettingsFile.read();
mySettingsFile.close();
myBounds = savedBounds.split(",");
for (i = 0; i<myBounds.length; i++) {
myBounds = Number(myBounds);
}
app.windows[0].bounds = myBounds;
} else {
beep();
if (confirm("Settings file is missing. Use current front window to set default?")) {
// User said: go to it.
new File(mySettingsFile);
mySettingsFile.open("w");
mySettingsFile.write(app.windows[0].bounds);
mySettingsFile.close();
}
}
}
Instructions:
1. Copy and paste the script into a new ExtendScript Toolkit document.
2. Save the script to the Desktop (temporarily) with the name "Reset Window Position.jsx".
3. Fire up InDesign CS4.
4. Open the Scripts panel.
5. Right-click the folder named User and choose Reveal in Finder.
6. Create a folder inside that folder named "Windows"
7. Drag the script into that folder.
8. Use Edit/Keyboard Shortcuts and assign the shortcut Ctrl-W to this script (or any shortcut of your choice).
9. Make sure that Application Frame is not active (also on the Window menu).
10. Open a document and get its window the way you want it.
11. Run the script for the first time. It will ask if you want to use the front window to set your preference. Say yes.
That's it. Now, you can resize your front window by using the shortcut at any time. To change the preferences, you can open the text file it creates in that same Windows folder and twiddle with the numbers. Or, you can run the script with no document open to delete the preferences (it asks you first) and then repeat steps 10 and 11.
Dave
Copy link to clipboard
Copied
Thank you. I will try it tonight.
Copy link to clipboard
Copied
Hi. I made a folder called Windows and then didn't know if I was
supposed to drag that inside the scripts folder so I did.
Then I tried to find the Edit/Keyboard Shortcuts which I couldn't find.
I tried to open a document but it opened to the whole desktop again.
What am I doing wrong.
Application Frame is not active.
6. Create a folder inside that folder named "Windows"
7. Drag the script into that folder.
8. Use Edit/Keyboard Shortcuts and assign the shortcut Ctrl-W to this script (or any shortcut of your choice).
9. Make sure that Application Frame is not active (also on the Window menu).
10. Open a document and get its window the way you want it.
11. Run the script for the first time. It will ask if you want to use the front window to set your preference. Say yes.
Copy link to clipboard
Copied
Hi again.
I found edit/shortcuts and went to windows.
Reset Window Position does not show up
??
Copy link to clipboard
Copied
Hi again. Also I opened windows twice and opened scripting and opened etc... till I got to Windows Reset Position.
I clicked on it and it resent the window... saved... reopened... window back to entire desktop width.
Thanks for help.
Copy link to clipboard
Copied
Yes, the Windows folder should be inside the Scripts Panel folder.
When you go to Edit/Keyboard Shortcuts you need to look for the Scripts section and then give the script a shortcut. If you have all the pre-installed scripts still in your Scripts panel you'll have to scroll down a long way to find it.
The script does nothing until you run it. The use of a shortcut is optional but if you don't have one it takes just as long to find the script in the panel as it does to fix the window manually.
Dave
Copy link to clipboard
Copied
OK I found scripts for keyboard shortcuts, I found reset window position.jsx.
Under new shortcut I put in Control/W
I clicked on OK
I got cannot modify the default set.
Create a new set based on the default set?
Now what? Thanks.
Copy link to clipboard
Copied
Take a deep breath.
Open a document.
Manually adjust the window to the size you want to be your default.
Run the script.
The script will ask you if you want the new size to be your default. Say yes (or OK or whatever the choice is).
Now, whenever you run the script it will make the front InDesign window that size.
Dave
Copy link to clipboard
Copied
Maybe I am asking the wrong ?
How do I run the script? Should I be doing something diff?? Thanks again.
Copy link to clipboard
Copied
Hi again. I found runs script but the make it default never came up. It just
makes the window bigger or to size. I must be doing something wrong.
Copy link to clipboard
Copied
Well, I think I messed things up. I had the scripting window open and
there was the reset window one and a default one. I deleted the default one and now
the scripting doesn't work at all... the window stays the entire size of the desktop.
Is there a way to undo the damage? Why can't CS4 just fix the problem? Thanks again.
Copy link to clipboard
Copied
There is nothing the script can do to change the size that InDesign uses to open a window.
What the script does is put you one keystroke away from getting the window to be the size you want it.
That's what it does. That's all that it does.
You just have to set up the defaults (as you did) and then run the script each time you create a new window.
Once you save a document and reopen it, it will open at the new size, but new windows will be at whatever size InDesign decides to make them.
Dave
Copy link to clipboard
Copied
Why won't it open at the new size when you save and reopen the doc? Why does it keep
opening the full size of desktop every time? Thanks again.
Copy link to clipboard
Copied
PS. I never got the window where it said, make the new size the default.
When I click on run script it just brings the window back and forth every
time? Thanks.
Copy link to clipboard
Copied
I give up. Is there some inexpesive way to buy CS3. I went from
CS2 to CS4?
Copy link to clipboard
Copied
Hi again. I let it create a new set based on the default set.
I opened the window and did control/w and it resized the window.
I saved and closed and reopened, the window was back to being the entire width of desktop.
Copy link to clipboard
Copied
I share Ann's frustration a little, though I was able to get the script going with the detailed instructs -- many thanks to Dave, this was bugging me to no end each time I opened something, at least now I can resize with a keystroke.
Why doesn't Adobe just let us set our own default screen-opening size in the Preferences?