The CLIP command can use files as input so you may be able to use that for the clip part:

>clip /?

CLIP

Description:
    Redirects output of command line tools to the Windows clipboard.
    This text output can then be pasted into other programs.

Parameter List:
    /?                  Displays this help message.

Examples:
    DIR | CLIP          Places a copy of the current directory
                        listing into the Windows clipboard.

    CLIP < README.TXT   Places a copy of the text from readme.txt
                        on to the Windows clipboard.

The powershell commands are probably more flexible:

> get-help Get-Clipboard

NAME
    Get-Clipboard

SYNOPSIS
    Gets the current Windows clipboard entry.


SYNTAX
Get-Clipboard [-Format {Text | FileDropList | Image | Audio}] [-Raw] [-TextFormatType {Text | UnicodeText | Rtf |
    Html | CommaSeparatedValue}] [<CommonParameters>]


DESCRIPTION
    The `Get-Clipboard` cmdlet gets the current Windows clipboard entry.


RELATED LINKS
Online Version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/get-clipboard?view=pow
    ershell-5.1&WT.mc_id=ps-gethelp
    Set-Clipboard

REMARKS
    To see the examples, type: "get-help Get-Clipboard -examples".
    For more information, type: "get-help Get-Clipboard -detailed".
    For technical information, type: "get-help Get-Clipboard -full".
    For online help, type: "get-help Get-Clipboard -online"
===
> get-help Set-Clipboard

NAME
    Set-Clipboard

SYNOPSIS
    Sets the current Windows clipboard entry.


SYNTAX
Set-Clipboard [-Append] [-AsHtml] -LiteralPath <String[]> [-Confirm] [-WhatIf] [<CommonParameters>]

Set-Clipboard [-Append] [-AsHtml] -Path <String[]> [-Confirm] [-WhatIf] [<CommonParameters>]

Set-Clipboard [-Value] <String[]> [-Append] [-AsHtml] [-Confirm] [-WhatIf] [<CommonParameters>]


DESCRIPTION
    The `Set-Clipboard` cmdlet sets the current Windows clipboard entry.


RELATED LINKS
Online Version: https://docs.microsoft.com/powershell/module/microsoft.powershell.management/set-clipboard?view=pow
    ershell-5.1&WT.mc_id=ps-gethelp
    Get-Clipboard

REMARKS
    To see the examples, type: "get-help Set-Clipboard -examples".
    For more information, type: "get-help Set-Clipboard -detailed".
    For technical information, type: "get-help Set-Clipboard -full".
    For online help, type: "get-help Set-Clipboard -online"
===
I suspect you can use file input and output for the powershell cmdlets also.

Cheers,
David

On 6/29/2020 12:11, greg heil wrote:
Wow, it actually works!
i even learned how to shell out of J to W10
The shell is a bit of a bottle neck though
it seems to have a length limitation.
    "The command line is too long"
perhaps i can send a string of lines, or
i may have to use file Foreign's
if there is not an undocumented clip Foreign.

~greg
http://krsnadas.org

--

from: David Mitchell <[email protected]>
to: [email protected]
date: Jun 29, 2020, 5:25 AM
subject: Re: [Jprogramming] copy/paste implementation

How about this:

shell 'echo This is a test | clip'

shell 'powershell -command "Get-Clipboard"'

David Mitchell

--

Thanks for the github location
sadly it too, has too many dependencies.
Still hoping for a raw Foreign

~greg
http://krsnadas.org

--

from: David Mitchell <[email protected]>
to: [email protected]
date: Jun 28, 2020, 7:49 PM
subject: Re: [Jprogramming] copy/paste implementation

Fixed typo.

If you are running Windows, this is available:

0!:0 <jpath'~Addons/general/misc/clippaste.ijs'

or

https://github.com/jsoftware/general_misc/blob/master/clippaste.ijs

or

https://raw.githubusercontent.com/jsoftware/general_misc/master/clippaste.ijs

Does this help?
David Mitchell

--

from: greg heil <[email protected]>
to: Programming forum <[email protected]>
date: Jun 28, 2020, 7:19 PM
subject: Re: [Jprogramming] copy/paste implementation

Sigh no
i am not really trying to code in bare metal 0s & 1s...
but i do not have access to load or pacman or...
Perhaps their is a URL for clippaste.ijs?

~greg
http://krsnadas.org

--

from: 'Pascal Jasmin'
to: [email protected]
date: Jun 28, 2020, 7:06 PM
subject: Re: [Jprogramming] copy/paste implementation

wdclippaste

wd@('clippaste'"_) ::(''"_)

it is part of wd framework.  Does that help?  wd is part of jqt.

--

from: greg heil <[email protected]>
to: Programming forum <[email protected]>
date: Jun 28, 2020, 6:47 PM
subject: copy/paste implementation

i am trying to access the copy/paste buffer directly (w/o pacman) but i am 
drawing a blank on how to do so. i seem to remember it was in Foreign 11 ... 
but that is skipped over. Perhaps the definition of clippaste.ijs has it... but 
i cannot find its definition online?

~greg
http://krsnadas.org
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to