highend wrote:You need to show the extra1 column in your list
Save the script in UTF-8 with BOM
Clicking outside the popupmenu -> nothing will happen
Clicking the first empty entry -> Tag will be nulled (no stars)
Happy tagging^^
Thanks highend for your code. I've been trying to hack it a little so that it works more consistently with Don's implementation. Don is saving numerical values and you are saving the stars. The advantage to saving numbers is that you can do a search like this: " Rating: > 3". which is very useful. So, I did a dirty hack on your code (because I don't know the syntax of these user scripts at all) to save the values as numbers.
Code: Select all
$empty = chr(13);
$rating = <<<>>>
$empty
☆
★
★☆
★★
★★☆
★★★
★★★☆
★★★★
★★★★☆
★★★★★
>>>;
$rating = regexreplace($rating, "^[ ]*");
$index = popupmenu($rating, , , , , 1, <crlf>, 0);
if ($index == 0) { end true; }
elseif ($index == 1) { $match = ""; }
else { $match = gettoken($rating, $index, <crlf>); }
if ($match =="") {$valuetosave=""}
if ($match =="☆") {$valuetosave=".5"}
if ($match =="★") {$valuetosave="1"}
if ($match =="★☆") {$valuetosave="1.5"}
if ($match =="★★") {$valuetosave="2"}
if ($match =="★★☆") {$valuetosave="2.5"}
if ($match =="★★★") {$valuetosave="3"}
if ($match =="★★★☆") {$valuetosave="3.5"}
if ($match =="★★★★") {$valuetosave="4"}
if ($match =="★★★★☆") {$valuetosave="4.5"}
if ($match =="★★★★★") {$valuetosave="5"}
tagitems(1, $valuetosave);
This saves properly in Tag.dat, but unfortunately it doesn't display properly because Don does a check on the Rating field, and if it's 1,2,3,4,5 it'll display the stars. But, it seems that it'll take the 1.5,2.5,3.5,4.5, values as integers and truncate the .5 and display the integer number of stars.
So using my hack, you'll get values stored properly and the search "Rating: > 3" will work properly, but you can't see ★★★☆, you'll only see ★★★.
Storing the stars allows this search "Rating:★★☆" to work, but not "Rating: > ★★☆".
I guess I could just use a different numeric field and just store numbers, and forget about displaying stars.