FasdUAS 1.101.10 k lX OX kW   l  5/ get parameters of current document from Safari^ get parameters of current document from Safari  r  n  1  pURL 4  docu m o 0longurllongURL r  n  1  pnam 4   docu m o 0title l ! l"# "nh creation of short URL based on http://www.leancrew.com/all-this/2007/11/long-and-shortened-url-scripts/#$$ creation of short URL based on http://www.leancrew.com/all-this/2007/11/long-and-shortened-url-scripts/!%& %l&'( 'l)* ).( set up curl command to create short URL*++P set up curl command to create short URL(,- ,r ./ .b01 0m2233Dcurl http://is.gd/api.php?longurl= 1l4 4n56 5I7 0 urlencode78 8o 0longurllongURL 6f /o 0cmd-9: 9l!!;< ; this is for tinyurl<==( this is for tinyurl:>? >l!!@A @^X set cmd to "curl http://tinyurl.com/api-create.php?url=" & (urlencode(longURL) of me) ABB set cmd to "curl http://tinyurl.com/api-create.php?url=" & (urlencode(longURL) of me) ?CD Cl!!DEF El!!GH G0* create short URL and copy it to clipboardHIIT create short URL and copy it to clipboardFJK Jr!(LM LI!&N .sysoexecTEXTTEXT No!" 0cmd Mo 0shorturlshortURLKOP OI)0Q .JonspClpnull**** Qc),RS Ro)* 0shorturlshortURL Sm*+  ctxtPTU Tl11UVW Vl11XY X! set up the Twitter messageYZZ6 set up the Twitter messageW[\ [r1:]^ ]b18_` _b16ab ab14cd co12 0title dm23eeff ( bo45 0shorturlshortURL `m67gghh) ^o 0status\ij il;;jkl kl;;mn m71 this URL opens Twitter with a predefined messagenoob this URL opens Twitter with a predefined messagelpq pl;;rs r@: replace & because it would cut the message if not escapedsttt replace & because it would cut the message if not escapedquv ur;Iwx wb;Eyz ym;>{{||>http://twitter.com/home?status= zl>D} }n>D~ ~I?D 0 urlencode o?@ 0status f>? xo 0twitterv lJJ lJJ 3- open Twitter in Safari and show the message Z open Twitter in Safari and show the message  IJO .miscactvnullnull IPW .GURLGURLnullTEXT oPS 0twitter msfrialisL Macintosh HDW H+ Safari.appk Applications:k|$Macintosh HD:Applications:Safari.app Safari.app Macintosh HDApplications/Safari.app/ l l l 2, is & really the only problematic character?X is & really the only problematic character? i I 0 urlencode o 0theurltheURL I 0 replacetext replaceText m& m%26 o 0theurltheURL l l l c] copied from http://foolsworkshop.com/applescript/2008/05/an-applescript-replace-text-method/ copied from http://foolsworkshop.com/applescript/2008/05/an-applescript-replace-text-method/ i I 0 replacetext replaceText o 0find o 0replace o 0subject k& r n 1  txdl 1  ascr o 0prevtidsprevTIDs r o 0find n 1  txdl 1  ascr r  n  2   citm o 0subject o 0subject l r o 0replace n 1  txdl 1  ascr r b m o 0subject o 0subject r# o 0prevtidsprevTIDs n 1 "  txdl 1  ascr l$$ L$& o$% 0subject l~}| ~ 0 urlencode }0 replacetext replaceText |.aevtoappnull****{zyx { 0 urlencodezwwv v0theurltheURLyu u0theurltheURLt t0 replacetext replaceTextx *m+srqp s0 replacetext replaceTextroonml n0find m 0replace l 0subjectqkjih k0find j 0replace i 0subject h0prevtidsprevTIDsgfe g ascr f txdl e citmp',EO,FO-EO,FO%EO,FOdcba d.aevtoappnull**** kX``cb_^]\[2ZYXWVUegT{SRQ _ docu ^ pURL ]0longurllongURL \ pnam [ 0title Z 0 urlencode Y0cmd X.sysoexecTEXTTEXT W0shorturlshortURL V ctxt U.JonspClpnull**** T 0status S 0twitter R.miscactvnullnull Q.GURLGURLnullTEXTaYU*k/,EO*k/,EO)k+%EOj EO&j O%%%EOa)k+%E`O*j O_j Uascr ޭ