Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] Path, Document Name, ETC.

Expand Messages
  • Stephen
    Hi Everyone, This week, I decided to improve my little clip to figure out what directory I happened to be in at the moment and came up with this improvement.
    Message 1 of 1 , Mar 28, 2001
    • 0 Attachment
      Hi Everyone,
      This week, I decided to improve my little clip to figure out what
      directory I happened to be in at the moment and came up with this
      improvement. It lets me know pretty quickly which built-in clip
      function is best to use, as I get them all confused.
      There are a couple of long lines, so beware of word wrapping.



      H="A File's Information"
      ^!SetArray %headers%="nlnlDirectory:tbtb tbtb";"nlnlName:tbtb tbtb
      tbtb";"nlnlExtension:tbtb tbtb";"nlnlDate:tbtb tbtb tbtb";"nlnlTime:tbtb
      tbtb tbtb";"nlnlName and Extension:tbtb";"nlnlSize:tbtb tbtb
      tbtb";"nlnlHeight:tbtb tbtb tbtb";"nlnlWidth:tbtb tbtb
      tbtb";"nlnlAttributes:tbtb tbtb";"nlnlRelative Nametbtb
      tbtb";"nlnlExpanded Name:tbtb tbtb"
      ;
      ^!Set %temp%=^%EMPTY%; %file%=^?{(T=O)What file do you wish to find the
      path, etc. of=^##}; %option%=^?{(T=A;H=15)Specify what you want to
      do==_Display this information about the file in a popup box^=popup|Enter
      this information about the file into the active document^=enter|Display
      labels about this data^=label|Display the file's
      directory^=directory|Display the file's name^=name|Display the file's
      extension^=extension|Display the file's Date^=date|Display the file's
      time^=time|Display the name and extension as one string^=namext|Display
      the file's size^=size|The image height^=height|The image
      width^=width|Display the file's attributes^=attributes|The Path relative
      to the active document^=relative|Display the fully qualified path
      against the active document's path^=expanded}
      ;Fulfill the label option
      ^!If ^$StrCount("label";"^%option%";FALSE;FALSE)$<1 NEXT ELSE SKIP
      ^!Set %headers%=^%EMPTY%
      ;directory
      ^!If ^$StrCount("directory";"^%option%";FALSE;FALSE)$>0 NEXT ELSE SKIP
      ^!Append %temp%="^%headers1%^$GetPath("^%file%")$"
      ;name
      ^!If ^$StrCount("name";"^%option%";FALSE;FALSE)$>0 NEXT ELSE SKIP
      ^!Append %temp%="^%headers2%^$GetName(^%file%)$"
      ;extension
      ^!If ^$StrCount("extension";"^%option%";FALSE;FALSE)$>0 NEXT ELSE SKIP
      ^!Append %temp%="^%headers3%^$GetExt("^%file%")$"
      ;date
      ^!If ^$StrCount("date";"^%option%";FALSE;FALSE)$>0 NEXT ELSE SKIP
      ^!Append %temp%="^%headers4%^$GetFileDate("^%file%")$"
      ;time
      ^!If ^$StrCount("time";"^%option%";FALSE;FALSE)$>0 NEXT ELSE SKIP
      ^!Append %temp%="^%headers5%^$GetFileTime("^%file%")$"
      ;name & extension
      ^!If ^$StrCount("namext";"^%option%";FALSE;FALSE)$>0 NEXT ELSE SKIP
      ^!Append %temp%="^%headers6%^$GetFileName("^%file%")$"
      ;size
      ^!If ^$StrCount("size";"^%option%";FALSE;FALSE)$>0 NEXT ELSE SKIP
      ^!Append %temp%="^%headers7%^$GetFileSize("^%file%")$"
      ;height
      ^!If ^$StrCount("height";"^%option%";FALSE;FALSE)$>0 NEXT ELSE SKIP
      ^!Append %temp%="^%headers8%^$GetImgHeight("^%file%")$"
      ;width
      ^!If ^$StrCount("width";"^%option%";FALSE;FALSE)$>0 NEXT ELSE SKIP
      ^!Append %temp%="^%headers9%^$GetImgWidth("^%file%")$"
      ;attributes
      ^!If ^$StrCount("attributes";"^%option%";FALSE;FALSE)$>0 NEXT ELSE SKIP
      ^!Append %temp%="^%headers10%^$GetFileAttr("^%file%")$"
      ;relative name
      ^!If ^$StrCount("relative";"^%option%";FALSE;FALSE)$>0 NEXT ELSE SKIP
      ^!Append %temp%="^%headers11%^$GetRelativeName("^%file%")$"
      ;expanded name
      ^!If ^$StrCount("expanded";"^%option%";FALSE;FALSE)$>0 NEXT ELSE SKIP
      ^!Append %temp%="^%headers12%^$GetExpandedName("^%file%")$"
      ;
      ^!Set %temp%="^$StrReplace("nlnl";"^P";"^%temp%";FALSE;FALSE)$"
      ^!Set %temp%="^$StrReplace("tbtb";"^T";"^%temp%";FALSE;FALSE)$"
      ;
      ;Qualify Popup box
      ^!If ^$StrCount("popup";"^%option%";FALSE;FALSE)$>0 NEXT ELSE printit
      ;The Popup Box
      ^!info [L] ^%temp%
      :printit
      ;Qualify entering into the document.
      ^!If ^$StrCount("enter";"^%option%";FALSE;FALSE)$>0 NEXT ELSE SKIP
      ^%temp%^%NL%
    Your message has been successfully submitted and would be delivered to recipients shortly.