Copy link to clipboard
Copied
In Illustrator you can set inches for the units by doing the following:
Go under "Illustrator Menu"
Select "Units " under "Preferences" menu item
Set "Stroke" to inches
Set "Type" to inches
How can I make a startup script so those values are set to inches for "Stroke" and "Type"?? So when a student makes a new document its already set to inches.
For Indesign I did the following with Applescript:
tell application "Adobe InDesign CS6"
tell view preferences
set ruler origin to page origin
set horizontal measurement units to inches
set vertical measurement units to inches
end tell
end tell
Can't get it scripted for Illustrator to default to inches. Anyone have any idea on how I would go about scripting this?
tell application "Adobe Illustrator"
tell startup presets
set ruler units to inches
end tell
end tell
Or something along those lines........
Copy link to clipboard
Copied
Look at DocumentPresets properties.
Copy link to clipboard
Copied
I actually have been, but unable to figure it out. Document Units, Ruler Units, etc. Still no luck....
tell application "Adobe Illustrator"
tell document preset
set document units to inches
end tell
end tell
Copy link to clipboard
Copied
AI does not have start-up scripts or events that can run your script the user would need to do this… You would have to do this outside of AI… Why don't you make a set of prefs any zip that or the parent Adobe Illustrator CS5 Settings folder… you could then script unpacking this zip at user log-in…
Copy link to clipboard
Copied
I found the preference and was able to change those settings, but it seems the pref is not "live", illustrator needs restart to pick up those values for now....until we found a way to trigger the change on the fly.
var units = 0; // 0-inches, 2-points
app.preferences.setIntegerPreference ("text/units",units);
app.preferences.setIntegerPreference ("strokeUnits",units);
...so, I wonder if it is possible to put this in the StartUp Scripts Folder, and as illustrator starts, a script would change the units, close illustrator right away and reopen it.
Copy link to clipboard
Copied
Thats how I have done it in the past, but InDesign seems to be buggy with doing this even if its prefs for Illustrator, which makes no sense to me. I just took out the InDesign Prefs from the user template and still had problems. Took out all Adobe prefs and then it was more stable. Tried to sneek just the Illustrator prefs back and InDesign started acting up again. Strange.
Copy link to clipboard
Copied
you can change them manually once, next time you restart illustrator it'll remember those settings
Copy link to clipboard
Copied
CarlosCanto wrote:
you can change them manually once, next time you restart illustrator it'll remember those settings
Yes, but the problem is I have the clients setup for students to where on every login they get a new Home Directory. On login the local User Template in OS X gets copied to the users Home Directory and is fresh settings for the user. Custom set Preferences are stored in the User Template, but InDesign CS6 isn't liking this anymore and I ended up having to remove all Adobe set prefs. Problems with this setup, the students can't save settings, but have saved alot on hassle's by students/faculty always having a new Home Directory and settings.
Tried over the years to have a more of a roaming profile type setup, but using MCX on OS X server just hasn't been reliable enough with syncing and what not. I have another solution setup that sets it up like how our Windows computers are setup, but I have it off because of other issues with software and working directly from an SMB share.
We have an Xserve mainly for MCX settings and software updates and all storage, authentication and printing is done from Windows Servers.
Copy link to clipboard
Copied
in that case, would you (or the students) have access to the startup script folder? even if a solution existed.
I can only think of having a startup script that uses "sendkeys" to illustrator, that's never recommended to use because the running "environment" has to be perfect otherwise it could wreck havoc, but it has work fine for me when I have no other choice.
"sendkeys" is windows only but I have seen examples of a similar nature for Mac. SendKeys simulate user input as if you were hitting the keyboard.
Copy link to clipboard
Copied
CarlosCanto wrote:
in that case, would you (or the students) have access to the startup script folder? even if a solution existed.
I can only think of having a startup script that uses "sendkeys" to illustrator, that's never recommended to use because the running "environment" has to be perfect otherwise it could wreck havoc, but it has work fine for me when I have no other choice.
"sendkeys" is windows only but I have seen examples of a similar nature for Mac. SendKeys simulate user input as if you were hitting the keyboard.
Yes access would be given. In my first post I am using a script for InDesign and so far it seems to be working well. The SendKeys equivalent in AppleScript would be keystroke. I have thought about that actually, but haven't got that far. I wasn hoping for a quick solution like for InDesign. Didn't think it would be that big of a deal for something so simple as setting the defaults to inches. Would think others would have requested this over the years.
Copy link to clipboard
Copied
Would think others would have requested this over the years.
oh, you InDesign users are so spoiled...requests here mean nothing...in this side of the world, with new releases, we don't expect any additions to the DOM, we're just happy to see previous features still work
Copy link to clipboard
Copied
CarlosCanto wrote:
Would think others would have requested this over the years.
oh, you InDesign users are so spoiled...requests here mean nothing...in this side of the world, with new releases, we don't expect any additions to the DOM, we're just happy to see previous features still work
Maybe, but this isn't for me I'm not an InDesign user.....lol Trying to do what was asked by the faculty!
Copy link to clipboard
Copied
hi dball, here you go, it works beautifully in Windows, Ai CS5. Let us know if you can translate it to mac
'change stroke and type units to inches
' vbs by carlos canto
Set objShell = CreateObject("WScript.Shell")
objShell.SendKeys "%E"
objShell.SendKeys "N"
objShell.SendKeys "U"
objShell.SendKeys "%S"
For i = 1 To 8
objShell.SendKeys "{UP}"
Next
For i = 1 To 2
objShell.SendKeys "{DOWN}"
Next
objShell.SendKeys "%T"
For i = 1 To 8
objShell.SendKeys "{UP}"
Next
objShell.SendKeys "{DOWN}"
objShell.SendKeys "{ENTER}"
Copy link to clipboard
Copied
CarlosCanto wrote:
hi dball, here you go, it works beautifully in Windows, Ai CS5. Let us know if you can translate it to mac
'change stroke and type units to inches ' vbs by carlos canto Set objShell = CreateObject("WScript.Shell") objShell.SendKeys "%E" objShell.SendKeys "N" objShell.SendKeys "U" objShell.SendKeys "%S" For i = 1 To 8 objShell.SendKeys "{UP}" Next For i = 1 To 2 objShell.SendKeys "{DOWN}" Next objShell.SendKeys "%T" For i = 1 To 8 objShell.SendKeys "{UP}" Next objShell.SendKeys "{DOWN}" objShell.SendKeys "{ENTER}"
This is probably sloppy code (I'm not a programmer/scripter) and the script works differently if run from Applescript Editor or double clicking the script on the desktop. I have it configured so you can double click it on the desktop and this would work for me because the settings for Illustrator on every login for students would be default, so this script should work fine. If you run it again under the same login then its not right, but I would assume the same goes for your script. I was thinking this whole time that Illustrator had a Startup Scripts folder like InDesign so thats fail.
tell application "Adobe Illustrator"
activate
end tell
delay 10
tell application "Finder"
activate
end tell
tell application "System Events"
tell application process "Adobe Illustrator"
tell menu bar 1
tell menu bar item "Illustrator"
tell menu "Illustrator"
tell menu item "Preferences"
tell menu "Preferences"
click menu item "Units..."
end tell
end tell
end tell
end tell
end tell
end tell
end tell
-- The commented code below could be the more simple way of doing whats above this line.
(*
tell application "Adobe Illustrator"
activate
tell application "System Events"
tell application process "Adobe Illustrator"
keystroke "," using command down
end tell
end tell
end tell
*)
tell application "Adobe Illustrator"
activate
end tell
tell application "System Events"
tell application process "Adobe Illustrator"
keystroke tab
select "Units"
keystroke tab -- Sure there is a better way to have all these tabs on one line didn't look into it.
keystroke tab
keystroke tab
keystroke tab
keystroke space
key code 125 -- down arrow
key code 125 -- down arrow
keystroke return
keystroke tab
keystroke space
key code 125 -- down arrow
keystroke return
keystroke tab
keystroke tab
keystroke tab
keystroke tab
keystroke tab
keystroke return
end tell
end tell
Copy link to clipboard
Copied
I have it configured so you can double click it on the desktop and this would work for me because the settings for Illustrator on every login for students would be default, so this script should work fine. If you run it again under the same login then its not right, but I would assume the same goes for your script.
honestly I have no idea why each log in would cause to loose the preferences, when I was going to school, everything was very restricted but going to the lab and using different machines, logging in would load the same preferences for the right student (windows by the way).
I have no idea how the startup folder works in Indesign, Illustrator has its own startup folder and it works just fine, any user script dropped in that folder will start running right after illustrator finishes loading.
Copy link to clipboard
Copied
I don't think it was ever supported by Adobe to have default prefs in place for all users, but it has always worked here on the Macs until InDesign CS6.5. No prefs are being lost, Indesign is unstable and crashes on startup because of a corrupt Defaults Preference file. We have never set default prefs on the PC's at all for any Adobe products here.
Sure your not getting Illustrator and Indesign mixed up? Well I am on a Mac, but would assume they are the same. I don't see a Startup Folder for Illustrator, only for InDesign.
Copy link to clipboard
Copied
When I went to school you had a note book ( the paper ones ). Windows we just looked out of when bored…
Copy link to clipboard
Copied
hahahah...Mark you're the best!
Copy link to clipboard
Copied
It could be why my math is so $hit…
Copy link to clipboard
Copied
Muppet Mark wrote:
AI does not have start-up scripts or events that can run your script the user would need to do this… You would have to do this outside of AI… Why don't you make a set of prefs any zip that or the parent Adobe Illustrator CS5 Settings folder… you could then script unpacking this zip at user log-in…
Now I see what you were talking about. I never looked to see if Illustrator had a Startup Scripts folder like Indesign. I assumed they would work the same way.
But like I said before:
Thats how I have done it in the past, but InDesign seems to be buggy with doing this even if its prefs for Illustrator, which makes no sense to me. I just took out the InDesign Prefs from the user template and still had problems. Took out all Adobe prefs and then it was more stable. Tried to sneek just the Illustrator prefs back and InDesign started acting up again. Strange.
Copy link to clipboard
Copied
dball5557 wrote: How can I make a startup script so those values are set to inches for "Stroke" and "Type"?? So when a student makes a new document its already set to inches.
Unrelated to the actual problem, but:
Do you think it's useful to teach students to measure stroke widths in inches? A typical stroke width for a standard graphic is 0.5 pt; in inches you need to enter "0.007 in".
The same, actually, goes for Type. Historically, Type sizes are in points -- 10 pts equals your average book font size, 12 pts is "a bit large", 18 pts is a good headline, and 40 pts is HUGE. In inches, that's (hold on, bringing on the calculator ..) 0.139, 0.167, 0.25, and 0.556.
Of course this is assuming your students are not going to design 40ft wide billboards ... at its actual size.
Copy link to clipboard
Copied
Thats a question for faculty, they have always wanted inches to be the default. I used to be able to set the prefs and simply put them into the User Template, but Indesign isn't liking that with CS 6. Making things difficult here! I put in a bug report with Adobe, but not sure anything will be done. I don't think putting the preset prefs in the User Template was ever supported in the past. Been getting lucky!