AutoHotkey Community

It is currently May 26th, 2012, 4:42 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: February 2nd, 2009, 10:48 am 
Offline

Joined: February 2nd, 2009, 10:43 am
Posts: 9
Location: Bangalore, India
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


Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 2nd, 2009, 11:06 am 
eagercyber wrote:
Hi,

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

Yet another Ask for Help


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2009, 6:59 pm 
Offline

Joined: July 30th, 2004, 8:50 pm
Posts: 192
:) Try PlainPaste!

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

Skrommel

Image

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


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 31st, 2009, 9:21 pm 
Offline

Joined: March 31st, 2009, 9:18 pm
Posts: 6
Location: Denmark
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 31st, 2009, 9:49 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
It works for me using notepad; ^v inserts ɑ and ^v^v inserts ?.

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 31st, 2009, 10:43 pm 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
Try this:
Code:
^+v::SendInput %ClipBoard%

Should make Ctrl+Shift+V "paste" unformatted text.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Miguel, notsoobvious and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group