Syntax for script active checkbox (new command)?

Hi guys,

Looking in the User Guide, can't find the syntax for the new command to interrogate the active state of an item. What was that again?

And is that read-only or set-able?

Best,
DF
Reply to #1:
Not sure what you mean by active state. Checked?

As of the portable version of 4.16, the available item properties are:
]   createdDate: string
]   checked: boolean
]   errorcode: integer
]   errorMessage: string
]   ext: string
]   filename: string
]   isAudio: boolean
]   isDocument: boolean
]   islmage: boolean
]   isVideo: boolean
]   GPSExists: boolean
]   mediaDate: string
]   mediaType: string
]   modifiedDate: string
]   name: string
]   newBasename: string
]   newExt: string
]   newName: string
]   newPath: string
]   path: string
]   size: integer
]   csv(columnlndex): string
]   metadata(fieldName): string

And, yes, I agree that (A) these should be in the User Guide and (B) Object.keys() should work properly on item. (^_^)
Reply to #2:

If you look on the Download page and click on Version Log or What's New, under Version 4.15 you'll see an item that says:

* Script method: The value of the item checkbox is now available in scripting

It's the checkbox in the Files list that shows whether an item is active or not. When 4.15 came out I think there was some more information available, because I tried it out and it worked ( can't remember if it was read-only, or you could set the state of the file). Now I can't remember how I did it. It's something like item.isActive() or app.itemActive() but I don't remember exactly. Kim will probably have to answer this one, I was just hoping someone had taken notice and had a better memory than my old dog-brain. :)

Best,
DF
Reply to #3:
item.checked shows if the file/folder's checkbox is ticked (item active, IE subject to renaming). It appears to be read only.
Reply to #4:

Ah, thanks, I was trying to make it too complicated...

Sure would be good to be changeable. That would potentially fix the problem with loading folders with subfolders and trying to rename them all at the same time. I tried to write a script to fix that, but without a way to actually have only one level at a time activated I couldn't get it right.

Have you encountered a situation when using a script to rename folders, where if your folder names contain periods ARen adds on whatever is after the first period a second (or multiple) time(s)?

EDIT: How did you figure out the item.checked thingie?

Best,
DF
Reply to #5:
I can count the number of times I've had to rename a folder that has periods, on one maybe two fingers. :D
(This does not include . and .. notation which my (non Aren) scripts use daily.)

Start a separate thread for that as it might be a fun puzzle.

As for item. One way is that Aren's script window has completion suggestions if you hand type item. , etc.

Since I normally code elsewhere and paste, that took me ages to notice...

A very quick check verified what item.checked was -- and that trying to change it was ineffective.

It being read-only seems like a trivial thing to work around though -- if I ever need to.
Reply to #1:
It is item.checked you are looking for. It is not documented but instead you can find it in the auto proposal dropdown in the script method. It is read only, so you cannot change the value in code, but if the new filename and the old filename is the same, the filename won't be changed anyway.

One could argue that files that aren't checked in the list, should not be sent to the script at all. But the scripting is presented in a more raw manner where it is expected that the user will take more control over the process on their own. ... or maybe I just forgot to filter out the non-checked items at some point, and don't want to change it now and introduce a potentially breaking change :-).
Reply to #7:

Hi Kim,

> and don't want to change it now and introduce a potentially breaking change :-).

And we don't want that either! :)

Have you ever noticed the "period bug" that I describe in my previous post (#5)? It's present in both v3 and v4, so I suspect it's probably external to the actual script engine. I thought I emailed you about that once, but I can't find it in my mail app, so maybe not...

Best,
DF
Reply to #8:
No, I have not noticed that issue. I very rarely rename folders with period (.). It might help to change the Apply To drop down to "Name and extension".
Reply to #9:

That worked! Thank you, oh mighty code warrior. :)

Like I tell everybody, you are tha MAN!

Oh, and I don't use periods in folder names *at all* anymore...

Best,
DF