I want to set them to the other vars
ClickData.func.sourcetab.selected_files
this will get a big number
and
ClickData.func.sourcetab.selected_files.name_stem
will go wrong.
I know just a little about script, anybody help me.
I want to set them to the other vars
ClickData.func.sourcetab.selected_files
this will get a big number
and
ClickData.func.sourcetab.selected_files.name_stem
will go wrong.
I know just a little about script, anybody help me.
name_stem
is a property of the Item object. selected_files
is not an Item object. That is why that fails.
I think you would do better by firstly focusing on understanding what the default script does (which appears when you create a script button).
This fragment of code may get you on the track you want:
Function OnClick(ByRef clickData)
If clickData.func.sourcetab.selected_files.count = 0 Then
Msgbox "Nothing is selected",16, "NO FILE SELECTED"
End If
ClipString = ""
For Each SelectedItem In ClickData.Func.sourcetab.Selected
dato = SelectedItem.create
ClipString = SelectedItem.name_stem
exto = SelectedItem.ext
'Discover the creation date of the file
pluggo =selectedItem.modify
pluggo = Cstr(pluggo)
pluggo = Left(pluggo,10)
pluggo =Right(pluggo,4)
msgbox clipstring + " " + exto + " " + pluggo
Next
End Function
It will loop through a list of selected files and throw out a message box giving the name of the file the extension and the year it was created. You can use the principle to get whatever info you need about your files.
Thank you auden, this script is very good, but there are 3 symbol wrong.
@scmaybee
Sorry, I do not follow. What do you mean that "3 symbol wrong"
The small script is just a quick demo of how to get file name info. Obviously you will need to adapt it to your particular needs.
The code works fine here.
@auden
there are “” but not "" in the previous code, you may have fixed it:grinning:
When you create a new script button, the default example script includes examples of common things you may need to do, including this. I recommend looking at it, as you may find the other parts useful as well. That is what it is for.
Example in JScript, since there's already a VBScript example in the thread. (The default example script will use the language you choose for the button.)
I've set another script as the default, how could I get the initial example now, is there a copy in somewhere?
The way to get the factory-default script is in the same menu you used to save over the default script.
Thank you, I have not noticed that at first.