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: xbytor, DavideBarranca, Paul MR

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

Script to lock guides

Post by ddiazetc » Fri Oct 25, 2019 1:34 am

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: 220
Joined: Mon Jul 25, 2016 12:36 pm

Re: Script to lock guides

Post by Kukurykus » Sat Oct 26, 2019 7:35 am

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 » Wed Oct 30, 2019 2:21 pm

What does that line of code do exactly, Kukurykus?

User avatar
Kukurykus
Posts: 220
Joined: Mon Jul 25, 2016 12:36 pm

Re: Script to lock guides

Post by Kukurykus » Thu Oct 31, 2019 7:46 pm

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

Post Reply