Make Stack Name = New Stack FileName

All flavors welcome.
Forum rules
Be kind.
User avatar
richmond62
Posts: 4833
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Make Stack Name = New Stack FileName

Post by richmond62 »

Great Compromise! 8-)
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 3210
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: Make Stack Name = New Stack FileName

Post by tperry2x »

Okay, glad that's worked out.

If you manually check for updates and re-download last update, it'll be the new version.
Image
TerryL
Posts: 114
Joined: Sat Oct 16, 2021 5:05 pm
Contact:

Re: Make Stack Name = New Stack FileName

Post by TerryL »

After a trial, I don't care for the naming dialog. Count me in the "no" column.

The revIDELibrary method names the file and stack simultaneously ensuring they're the same with a 6-line fix that's fast and effective, eliminating the need for an extra naming dialog. It's what other programs do. Give it a try.

in stack "RevIDELibrary", at about line 7597, in Toolset > Libraries:

Code: Select all

# Check if the stack has a filename. IF not, redirect to save as
   if the effective filename of stack tStackName is empty then
      revIDEActionSaveStackAs the long ID of stack tStackName
--add the following code--------------
      set the itemDel to slash
      get item -1 of the effective filename of stack tStackName  --short name.extention
      if it <> empty then  --user entered a name
         set the itemDel to "."
         set the name of stack tStackName to item 1 of it  --short name
      end if
--end add---------------------
      exit revIDESaveStack
   end if
User avatar
tperry2x
Posts: 3210
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: Make Stack Name = New Stack FileName

Post by tperry2x »

TerryL wrote: Sat Dec 28, 2024 5:48 pm After a trial, I don't care for the naming dialog. Count me in the "no" column.
in stack "RevIDELibrary", at about line 7597, in Toolset > Libraries
Edit: Got you, and I added a couple of small tweaks (credited you for this though):

Code: Select all

-- terryL's script for renaming the stack on save
      put the itemDelimiter into tOldDelim
      set the itemDelimiter to slash
      get item -1 of the effective filename of stack tStackName  --short name.extention
      if it <> empty then  --user entered a name
         set the itemDel to "."
         if the title of stack tStackName is "" then set the title of stack tStackName to item 1 of it
         set the name of stack tStackName to item 1 of it  --short name
      end if
      set the itemDelimiter to tOldDelim
      -- end terryL's script (28-12-24)
 
This way, it sets the title of the stack too (if it's empty) - no more * on stack titles (if the user hasn't set one).
It also restores the itemDelimiter to whatever it was before this bit of script runs.
User avatar
tperry2x
Posts: 3210
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: Make Stack Name = New Stack FileName

Post by tperry2x »

I've also made the rename on new stack a prefs setting. So those who like it can turn it on, those who don't can leave it off. (default is off)
prompt-rename.png
prompt-rename.png (36.63 KiB) Viewed 616 times
If you manually check for updates and re-download last update, it'll be the new version.
Image

Oh, almost forgot: I also added the check for curl (in case you run the updater on a linux distro without it). Thanks Richmond. (Still can't work out why Xubuntu doesn't include this).
TerryL
Posts: 114
Joined: Sat Oct 16, 2021 5:05 pm
Contact:

Re: Make Stack Name = New Stack FileName

Post by TerryL »

Herding cats would be easier than satisfying opinionated puds like me. I don't know how you do it. Thanks tperry.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests