AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Paste Special - shortcuts ?

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
eagercyber



Joined: 02 Feb 2009
Posts: 9
Location: Bangalore, India

PostPosted: Mon Feb 02, 2009 9:48 am    Post subject: Paste Special - shortcuts ? Reply with quote

Hi,

For many MS Office applications, we have Paste Special option. Is there any way to create shortcuts for Paste Special + Unformatted text ? That would help to paste the matter on the fly

Thanks
Back to top
View user's profile Send private message
wrong section alert
Guest





PostPosted: Mon Feb 02, 2009 10:06 am    Post subject: Re: Paste Special - shortcuts ? Reply with quote

eagercyber wrote:
Hi,

Is there any way to create shortcuts for Paste Special + Unformatted text? Thanks

Yet another Ask for Help
Back to top
skrommel



Joined: 30 Jul 2004
Posts: 190

PostPosted: Mon Feb 02, 2009 5:59 pm    Post subject: Reply with quote

Smile Try PlainPaste!

Press Ctrl-V once to paste regularly, or twice fast to paste as text.

Skrommel



Code:
;PlainPaste.ahk
; Press Ctrl-V once to paste regularly, or twice fast to paste as text.
; Also Control Ctrl-C and Ctrl-X.
;Skrommel @2006

#SingleInstance,Force
SetBatchLines,-1
StringTrimRight,applicationname,A_ScriptName,4
Gosub,TRAYMENU
Gosub,INI
pastecounter=0
copycounter=0
cutcounter=0
Return

PASTEONCE:
pastecounter+=1
SetTimer,PASTETWICE,%delay%
Return

PASTETWICE:
SetTimer,PASTETWICE,Off
wholeclipboard:=ClipboardAll
If pastecounter>1
  Clipboard=%Clipboard%
pastecounter=0
Send,^v
Clipboard:=wholeclipboard
Return


COPYONCE:
copycounter+=1
SetTimer,COPYTWICE,%delay%
Return

COPYTWICE:
SetTimer,COPYTWICE,Off
Send,^c
If copycounter>1
  Clipboard=%Clipboard%
copycounter=0
Return

CUTONCE:
cutcounter+=1
SetTimer,CUTTWICE,%delay%
Return

CUTTWICE:
SetTimer,CUTTWICE,Off
Send,^x
If cutcounter>1
  Clipboard=%Clipboard%
cutcounter=0
Return


INI:
IfNotExist,%applicationname%.ini
{
  ini=`;%applicationname%.ini
  ini=%ini%`n[Settings]
  ini=%ini%`nplainpaste=1
  ini=%ini%`nplaincopy=0
  ini=%ini%`nplaincut=0
  ini=%ini%`ndelay=333
  FileAppend,%ini%,%applicationname%.ini
  ini=
}
IniRead,plainpaste,%applicationname%.ini,Settings,plainpaste
IniRead,plaincopy,%applicationname%.ini,Settings,plaincopy
IniRead,plaincut,%applicationname%.ini,Settings,plaincut
IniRead,delay,%applicationname%.ini,Settings,delay
If plainpaste=1
  Hotkey,$^v,PASTEONCE,On
If plaincopy=1
  Hotkey,$^c,COPYONCE,On
If plaincut=1
  Hotkey,$^x,CUTONCE,On
Return


SETTINGS:
Gui,Destroy
Gui,Add,GroupBox,xm w250 h80,&Hotkeys
Gui,Add,CheckBox,xm+10 yp+20 Checked%plainpaste% Vsplainpaste,Plain &Paste (Ctrl-V)
Gui,Add,CheckBox,xm+10 yp+20 Checked%plaincopy% Vsplaincopy,Plain &Copy (Ctrl-C)
Gui,Add,CheckBox,xm+10 yp+20 Checked%plaincut% Vsplaincut,Plain C&ut (Ctrl-X)
Gui,Add,GroupBox,xm y+20 w250 h50,&Delay between double key presses (default=333)
Gui,Add,Edit,xm+10 yp+20 w230 r1 vsdelay,%delay%
Gui,Add,Button,xm y+20 w75 GSETTINGSOK,&OK
Gui,Add,Button,x+5 w75 GSETTINGSCANCEL,&Cancel
Gui,Show,w270,%applicationname% Settings
Return

SETTINGSOK:
Gui,Submit
If plainpaste=1
  Hotkey,$^v,PASTEONCE,Off
If plaincopy=1
  Hotkey,$^c,COPYONCE,Off
If plaincut=1
  Hotkey,$^x,CUTONCE,Off
plainpaste:=splainpaste
plaincopy:=splaincopy
plaincut:=splaincut
If sdelay<>
  delay:=sdelay
IniWrite,%plainpaste%,%applicationname%.ini,Settings,plainpaste
IniWrite,%plaincopy%,%applicationname%.ini,Settings,plaincopy
IniWrite,%plaincut%,%applicationname%.ini,Settings,plaincut
IniWrite,%delay%,%applicationname%.ini,Settings,delay
Gosub,SETTINGSCANCEL
Return

SETTINGSCANCEL:
Gui,Destroy
If plainpaste=1
  Hotkey,$^v,PASTEONCE,On
If plaincopy=1
  Hotkey,$^c,COPYONCE,On
If plaincut=1
  Hotkey,$^x,CUTONCE,On
Return


TRAYMENU:
Menu,Tray,NoStandard
Menu,Tray,DeleteAll
Menu,Tray,Add,%applicationname%,ABOUT
Menu,Tray,Add,
Menu,Tray,Add,Se&ttings...,SETTINGS
Menu,Tray,Add,&About...,ABOUT
Menu,Tray,Add,E&xit,EXIT
Menu,Tray,Default,%applicationname%
Menu,Tray,Tip,%applicationname%
Return


ABOUT:
Gui,99:Destroy
Gui,99:Margin,20,20
Gui,99:Add,Picture,xm Icon1,%applicationname%.exe
Gui,99:Font,Bold
Gui,99:Add,Text,x+10 yp+10,%applicationname% v1.0
Gui,99:Font
Gui,99:Add,Text,y+10,Press Ctrl-V once to paste regularly, or twice fast to paste as text.
Gui,99:Add,Text,y+5,- Also control Ctrl-C and Ctrl-X.
Gui,99:Add,Text,y+5,- Change the settings by choosing Settings in the Tray menu.

Gui,99:Add,Picture,xm y+20 Icon5,%applicationname%.exe
Gui,99:Font,Bold
Gui,99:Add,Text,x+10 yp+10,1 Hour Software by Skrommel
Gui,99:Font
Gui,99:Add,Text,y+10,For more tools, information and donations, please visit
Gui,99:Font,CBlue Underline
Gui,99:Add,Text,y+5 G1HOURSOFTWARE,www.1HourSoftware.com
Gui,99:Font

Gui,99:Add,Picture,xm y+20 Icon7,%applicationname%.exe
Gui,99:Font,Bold
Gui,99:Add,Text,x+10 yp+10,DonationCoder
Gui,99:Font
Gui,99:Add,Text,y+10,Please support the contributors at
Gui,99:Font,CBlue Underline
Gui,99:Add,Text,y+5 GDONATIONCODER,www.DonationCoder.com
Gui,99:Font

Gui,99:Add,Picture,xm y+20 Icon6,%applicationname%.exe
Gui,99:Font,Bold
Gui,99:Add,Text,x+10 yp+10,AutoHotkey
Gui,99:Font
Gui,99:Add,Text,y+10,This tool was made using the powerful
Gui,99:Font,CBlue Underline
Gui,99:Add,Text,y+5 GAUTOHOTKEY,www.AutoHotkey.com
Gui,99:Font

Gui,99:Show,,%applicationname% About
hCurs:=DllCall("LoadCursor","UInt",NULL,"Int",32649,"UInt") ;IDC_HAND
OnMessage(0x200,"WM_MOUSEMOVE")
Return

1HOURSOFTWARE:
  Run,http://www.1hoursoftware.com,,UseErrorLevel
Return

DONATIONCODER:
  Run,http://www.donationcoder.com,,UseErrorLevel
Return

AUTOHOTKEY:
  Run,http://www.autohotkey.com,,UseErrorLevel
Return

99GuiClose:
  Gui,99:Destroy
  OnMessage(0x200,"")
  DllCall("DestroyCursor","Uint",hCur)
Return

WM_MOUSEMOVE(wParam,lParam)
{
  Global hCurs
  MouseGetPos,,,,ctrl
  If ctrl in Static9,Static13,Static17
    DllCall("SetCursor","UInt",hCurs)
  Return
}
Return


EXIT:
ExitApp

_________________
www.1HourSoftware.com
Back to top
View user's profile Send private message Visit poster's website
sunwei415



Joined: 31 Mar 2009
Posts: 6
Location: Denmark

PostPosted: Tue Mar 31, 2009 8:21 pm    Post subject: trouble pasting special characters Reply with quote

I copy the following into the clipboard:
"The occupations are denoted PN,ɑ, where N is the number of electrons and ɑ labels the different states with N electrons."

But I get the following while pasting via plainpaste:

"The occupations are denoted PN,?, where N is the number of electrons and ? labels the different states with N electrons."

Can anybody point out what's wrong?

Thanks.
Back to top
View user's profile Send private message MSN Messenger
tonne



Joined: 06 Jun 2006
Posts: 1651
Location: Denmark

PostPosted: Tue Mar 31, 2009 8:49 pm    Post subject: Reply with quote

It works for me using notepad; ^v inserts ɑ and ^v^v inserts ?.
_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2
Back to top
View user's profile Send private message
ManaUser



Joined: 24 May 2007
Posts: 1121

PostPosted: Tue Mar 31, 2009 9:43 pm    Post subject: Reply with quote

Try this:
Code:
^+v::SendInput %ClipBoard%

Should make Ctrl+Shift+V "paste" unformatted text.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group