Sourcepath name to clipboard

Hi, I’m having an issue with this commands and could use some help. The script I’m using is:

@if:Common
Clipboard SET {sourcepath|nopath|noterm}
@if:else
Clipboard COPYNAMES=nopaths,noexts

What I want is that when nothing is selected, it should copy the name of the current folder without adding quotes, even if the name contains spaces. When something is selected, it should copy the folder names or filenames without their extensions. I was hoping to do so by not writing jscript, would there be a way to achieve this?

Try

@ifsel:numfiles=0
@nofilenamequoting
Clipboard SET {sourcepath|nopath|noterm}
@ifsel:else
Clipboard COPYNAMES=nopaths,noexts
2 Likes

To make it check for both files and dirs, you can change the first line:

@ifsel:numfiles=0,numdirs=0
@nofilenamequoting
Clipboard SET {sourcepath|nopath|noterm}
@ifsel:else
Clipboard COPYNAMES=nopaths,noexts
1 Like

Any reason this would not work. I am running the dopusrt from AHK, creating a command like this

RUN %dopusRTGLOB% /cmd Clipboard COPYNAMES=nopaths,noexts

I get the filename (no path) but EXT is still there.
Driving me LOCO :upside_down_face:

Should i be using acmd (although i don't really understand why its used lol)
Any ideas ?

You probably have something wrong on the AHK side, not the Opus side. Make sure your command line is properly quoted so the , isn't interpreted as the next argument to the AHK function you are running.

1 Like

I figured it out !!! IT was on the AHK side.... but its weird.

This worked:

RUN, "%dopusRTGLOB%"   /cmd Clipboard  COPYNAMES=nopaths`,noexts

Drove me crazy - had to escape the stupid comma !!! :nerd_face: :upside_down_face:

1 Like