Script to lock guides

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

ddiazetc
Posts: 1
Joined: Fri Oct 25, 2019 1:18 am

Script to lock guides

Post by ddiazetc »

Hi,
I'm looking to create a script that can lock guides in a PS document (I'd like to do this for some 200 PS documents that have guides in them but none of them have locked guides, and I just don't want to lock them all by hand), but I'm having trouble finding the right method to do so in this documentation: https://www.adobe.com/content/dam/acom/ ... f-2019.pdf

There is activeDocument.guides.add (Direction.HORIZONTAL,UnitValue(20,20)) for example, but no "activeDocument.guides.lock". Is locking the guides a property of another object, or a method belonging to some other object?

Thanks a lot!

(Haven't posted on a forum like this in years. Cheers to these "Smilies"! :mrgreen: )
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: Script to lock guides

Post by Kukurykus »

Code: Select all

runMenuItem(stringIDToTypeID('toggleLockGuides'))
Palomares
Posts: 1
Joined: Tue Oct 29, 2019 11:10 am

Re: Script to lock guides

Post by Palomares »

What does that line of code do exactly, Kukurykus?
User avatar
Kukurykus
Posts: 528
Joined: Mon Jul 25, 2016 12:36 pm

Re: Script to lock guides

Post by Kukurykus »

it locks guides in the document, so you can't drag them until you use that 'line of code' again.