Page 1 of 1

A new variable : <clipboard>

Posted: 10 Feb 2008 13:02
by jacky
I'd love a new variable to be added : <clipboard>
I don't really have to explain what it would be, do I? ;)

Posted: 10 Feb 2008 13:14
by PeterH
...you want to read, what you wrote by copytext[a]? :)

Posted: 10 Feb 2008 13:45
by jacky
PeterH wrote:...you want to read, what you wrote by copytext[a]? :)
No, but I'd like for example to have a script that :
- goes somewhere
- select all files
- move/copy/compress/whatever with them
- goes back where i was before
- tell me : ok, it's done, and list all the files that were "affected". I know I can copy their names (using To Clipboard commands) but I can't use that in msg/text or anywhere for that matter... I'd like that! :)

Posted: 10 Feb 2008 14:30
by PeterH
Hi Jacky,
I could think of re-reading the just set clipboard to verify what I have set, (for test before I really use it,) but I also thought of reading "other" info from there.
(But, as often, wanted to make a little joke there :) )

Now these jokes can be quite useful - I didn't have that idea you mentioned! Really good!
...but "only" for varification of the list - as you get a quite long list in one variable, and cannot refer to single entries. Shure it could make sense to read it and react on some contents...
..so it would be fine to have a ::substring (or a substring-subfunction for ::set) to extract "items" of a text-string. for example the 3rd line, or the 5th word, etc.
(Sorry, Don, for the next wish - ok, call it idea...
...and it still can get harder...)

and I'm afraid that would make need of loops, and of IF, ...
OK - next version? Next week :roll:

Posted: 11 Feb 2008 09:09
by admin
PeterH wrote:..so it would be fine to have a ::substring (or a substring-subfunction for ::set) to extract "items" of a text-string. for example the 3rd line, or the 5th word, etc.
Yes, I already thought of some basic string functions. Later...

Re: A new variable : <clipboard>

Posted: 11 Feb 2008 09:10
by admin
jacky wrote:I'd love a new variable to be added : <clipboard>
I don't really have to explain what it would be, do I? ;)
Question:
- what if the clipboard is empty?
- what if the clipboard holds an image?

Re: A new variable : <clipboard>

Posted: 11 Feb 2008 09:23
by j_c_hallgren
admin wrote:Question:
- what if the clipboard is empty?
- what if the clipboard holds an image?
Maybe that usage of <clipboard> wouldn't be valid (or it would be null value) unless it has been previously set within the script? Because clipboard could have all kinds of stuff from external sources, including bitmaps, spreadsheet data, etc. when script begins...and it seems that script can likely only set it to more plain text values that would then be able to be used later in script.

Re: A new variable : <clipboard>

Posted: 11 Feb 2008 10:26
by fishgod
admin wrote:
jacky wrote:I'd love a new variable to be added : <clipboard>
I don't really have to explain what it would be, do I? ;)
Question:
- what if the clipboard is empty?
- what if the clipboard holds an image?
empty clipboard = emptystring
image in clipboard = #image
somthing other than text in clipboard = #something (where something is not the content, but the type of the content, when you can determine it, else #unknown, or something)

??

Re: A new variable : <clipboard>

Posted: 11 Feb 2008 10:43
by jacky
admin wrote:
jacky wrote:I'd love a new variable to be added : <clipboard>
I don't really have to explain what it would be, do I? ;)
Question:
- what if the clipboard is empty?
- what if the clipboard holds an image?
Just returns nothing, both case. Open your text editor and press Ctrl+V when the clipboard is empty/contains an image, files, some other data, what happens : nothing. That's the expected behavior.

Re: A new variable : <clipboard>

Posted: 11 Feb 2008 10:48
by admin
jacky wrote:
admin wrote:
jacky wrote:I'd love a new variable to be added : <clipboard>
I don't really have to explain what it would be, do I? ;)
Question:
- what if the clipboard is empty?
- what if the clipboard holds an image?
Just returns nothing, both case. Open your text editor and press Ctrl+V when the clipboard is empty/contains an image, files, some other data, what happens : nothing. That's the expected behavior.
Ah, you wanted only the text?! I made it to return any files a well (converted to text, one per line).

Re: A new variable : <clipboard>

Posted: 11 Feb 2008 10:50
by fishgod
admin wrote:Ah, you wanted only the text?! I made it to return any files a well (converted to text, one per line).
maybe something like <clipboard> returns all the text included and <clipboard,n> returns the line with the number n, if there are more then one?

Re: A new variable : <clipboard>

Posted: 11 Feb 2008 11:40
by jacky
admin wrote:Ah, you wanted only the text?! I made it to return any files a well (converted to text, one per line).
Well, I pretty much focused on text only yes, and had in mind other data type like pictures, etc.
I throw files in the mix without really thinking about it. :roll: But putting the path/names of files in the clipboard might be a good thing actually, so don't remove it! ;)

Posted: 11 Feb 2008 16:12
by PeterH
My opinion: only return the list, i.e. the names of the files, or whatever.

On the other side, (later on,) there should be a command supporting file-I/O. Then, if you have a filename, you can read or write or do what you want. But I think that's a level of logic, that's too much at the moment.
(As, for handling that, you need "higher" comands like loops, IF, ...)