×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    9

    Copy and Paste Texts

    how can i copy texts and paste texts?

  2. #2
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,777

    Re: Copy and Paste Texts

    Quote Originally Posted by purple-boy View Post
    how can i copy texts and paste texts?
    Hi Purple-boy,

    Luckily we have an extension for this - Clipboard module.

    Code:
    import clipboard
    
    clip=clipboard.Get()
    print clip  # print "hello"
    clipboard.Set(u"bye") # change clipboard contents with "bye"
    print clipboard.Get() # print "bye"
    link : Power Clipboard tool for PyS60 1.1 by Atrant

    Thread Link


    Best Regards
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    9

    Re: Copy and Paste Texts

    croozeus ur script doesnt work on my nokia 6600 why?? or how can i copy paste from phone's clipboard?? i mean by using like PEN KEY+RIGHT SOFT KEY???

  4. #4
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,777

    Re: Copy and Paste Texts

    Quote Originally Posted by purple-boy View Post
    croozeus ur script doesnt work on my nokia 6600 why?? or how can i copy paste from phone's clipboard?? i mean by using like PEN KEY+RIGHT SOFT KEY???
    Hi purple-boy,

    Yes,in general, if while writing some text you need to paste something, then you can use the pen + the right softkey.

    But if you want to copy and paste texts using Pys60 you need to use the clipboard module.
    The clipboard module is for 2nd as well as 3rd Ed devices, so it should work.

    Best Regards
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Copy and Paste Texts

    Quote Originally Posted by purple-boy View Post
    croozeus ur script doesnt work on my nokia 6600 why?? or how can i copy paste from phone's clipboard?? i mean by using like PEN KEY+RIGHT SOFT KEY???
    HI purple-boy
    can u plz tell me what error msg you got using croozeus code.
    thanks

  6. #6
    Registered User
    Join Date
    Mar 2008
    Posts
    9

    Re: Copy and Paste Texts

    croozeus code now works fine. Then i want to knw how to paste text in to text messege (text message opened) or to notes etc.

    Thanks

  7. #7
    Registered User
    Join Date
    Jun 2008
    Posts
    18

    Re: Copy and Paste Texts

    Hi, Will the code below work on external apps? I mean Can we write something using Python and paste it to a chat window ( of a chat application)? I'm sure appswitch.pyd should be used in this. But is
    it really possible to paste on an external app?

    I'm thinking of integrating this idea with making a flood script

  8. #8
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,777

    Smile Re: Copy and Paste Texts

    Quote Originally Posted by purple-boy View Post
    croozeus code now works fine. Then i want to knw how to paste text in to text messege (text message opened) or to notes etc.

    Thanks
    Use appswitch with appropriate delay to paste the text to notes or messaging application,

    Quote Originally Posted by nadym89 View Post
    Hi, Will the code below work on external apps?
    IMHO, It should work. And for switching applications, you can do it either manually or use the appswitch module.

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  9. #9
    Registered User
    Join Date
    Jun 2008
    Posts
    18

    Re: Copy and Paste Texts

    Hey, tried this on Messaging and on a chat application(Mig33). But I couldn't succeed. The appswitch works fine. But the text is not pasted.

    I used appswitch and clipboard as the modules.

    Can anyone give an example that work for pasting texts to a chat application(mig33) or else to Messaging?

  10. #10
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,777

    Re: Copy and Paste Texts

    Quote Originally Posted by nadym89 View Post
    Hey, tried this on Messaging and on a chat application(Mig33). But I couldn't succeed. The appswitch works fine. But the text is not pasted.

    I used appswitch and clipboard as the modules.

    Can anyone give an example that work for pasting texts to a chat application(mig33) or else to Messaging?
    If it didn't work I guess you will need to use the keypress module with it.

    It goes like this.

    Code:
    import clipboard
    
    
    text= clipboard.Get()
    
    #Do the application switching here with appswitch
    
    for i in text:
        if (i=='a'):
            #Simulate 'a'
        .
        .
        . and so on!
    Its a funny and an unconventional way.
    I haven't tested it, Just clicked in my mind

    Use it if the below doesn't work

    Code:
    import clipboard
    
    
    text= clipboard.Get()
    
    #Do the application switching here with appswitch
    
    clipboard.Get()
    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  11. #11
    Registered User
    Join Date
    Jun 2008
    Posts
    1

    Red face Re: Copy and Paste Texts

    here is my code:
    Code:
    import clipboard
    def doCopy():#复制
      myText = appuifw.app.body.get()
      clipboard.Set(myText)
    def doPaste():#粘贴
      myText=clipboard.Get()
      tab_code.add(myText)
    but it does not support Chinese, even I write the code like this:
    Code:
    import clipboard
    def doCopy():#复制
      myText = appuifw.app.body.get()
      clipboard.Set(myText.encode('utf-8'))
    def doPaste():#粘贴
      myText=clipboard.Get()
      tab_code.add(myText.decode('utf-8'))
    Can anyone help me? pls

  12. #12
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,777

    Re: Copy and Paste Texts

    I am not sure if Clipboard extension supports Chinese.

    May be it doesn't

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  13. #13
    Registered User
    Join Date
    Apr 2010
    Posts
    1

    Re: Copy and Paste Texts

    Hi, I'm having troubles copying pasting into another app in my E71 using this module. I grab UTF-8 text and put it into the clipboard using this clipboard.py module, but I can paste it only within the pys60 console and in no external app. In external apps, holding the Shift key doesn't show Copy/Paste menu.

    It doesn't work the other way around too (copy from external app and pasting in pys60 console, using the clipboard.Get())

    Can you help me out with that?

    I import clipboard module like this:

    Code:
    import sys, appuifw, e32
    sys.path.append("c:\\data\\python")
    import clipboard
    because I can't access my c:\\python\lib directly to put the module there.

  14. #14
    Registered User
    Join Date
    Apr 2008
    Posts
    26

    Re: Copy and Paste Texts

    Quote Originally Posted by croozeus View Post
    Hi Purple-boy,

    Luckily we have an extension for this - Clipboard module.

    Code:
    import clipboard
    
    clip=clipboard.Get()
    print clip  # print "hello"
    clipboard.Set(u"bye") # change clipboard contents with "bye"
    print clipboard.Get() # print "bye"
    link : Power Clipboard tool for PyS60 1.1 by Atrant

    Thread Link


    Best Regards
    Croozeus
    Hi Croozeus!

    Sorry your link doesn't work anymore. Is there another download address?

    Ciao Peter

Similar Threads

  1. Replies: 1
    Last Post: 2009-02-12, 07:29
  2. copy / paste ... in CEikRichTextEditor
    By Jeepy in forum Symbian C++
    Replies: 1
    Last Post: 2007-01-17, 14:14
  3. In CEikGlobalTextEditor copy paste problem
    By birinder in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-08-09, 06:49
  4. Copy TPtrC or TBuf to clipboard
    By ArjenBroeze in forum Symbian C++
    Replies: 2
    Last Post: 2006-06-07, 20:51
  5. CEikRichTextEditor problem with Cut and Copy.
    By skdas in forum Symbian C++
    Replies: 0
    Last Post: 2003-06-05, 13:18

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •