Jump to content

Recommended Posts

Posted

First and foremost i would like to greet the AutoIt community for creating such powerful tool! :bye:

I've recently discovered a program named Transfz that ables me to use AutoIt BASIC code to create extentions. Since i have close to none programming skills, i would be very thankful if someone could point me in the right direction in order to script something as basic as copying the last sub-directory string to the clipboard:

"c:\directory\part_to_be_copied"

I'm not entirely sure if it's scriptable since search engine extentions are set like this:

[hotkeycombo]
accelerator_shift=+
accelerator_ctrl=^
accelerator_alt=
key=c
[searchengine]
url=http://www.youtube.com/
string=results?search_query=*&search=Search

Thank you for your attention! :)

Posted (edited)

There is most likely a safer rexexp, but if the path is always like that this might suffice.

;MsgBox(0,0,_Paste("c:directorypart_to_be_copied"))
ClipPut(_Paste("c:directorypart_to_be_copied"))
Func _Paste($str)
   $pos = StringInStr($str, "",0,-1)
   $len = StringLen($str)
   $dir = StringRight($str,$len - $pos)
   Return $dir
EndFunc

EDIT:

ClipPut()

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

  • Moderators
Posted

Looks pretty similar to Ini functions?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Thank you for replying in so short notice!

I didn't explain myself quite clear. I wanted a script to copy the last directory of a path, that was just a visual representation, sorry if it looks misleading... :)

  • Moderators
Posted (edited)

You're in a programming forum. You'll find the guys that love to chase posts are eager to hypothesize on what you want, and even provide code you probably won't understand.

When posting here, to get the quickest, most precise result, I'd suggest you put in detail what you've are looking to do, and what you've done so far that has not acheived the desired result.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Thank you for replying in so short notice!

I didn't explain myself quite clear. I wanted a script to copy the last directory of a path, that was just a visual representation, sorry if it looks misleading... Posted Image

I was not confused or anything, but I am a little now, that was a path you provided was it not?

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

I want to copy the lowest part of a path at all times:

c:exampleexampleexamplei_only_want_this_copied_to_clipboard

c:another_examplesame_applies_here

:)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...