Daniel Paquin Posted March 6, 2011 Posted March 6, 2011 " DesktopPath: " & Get(DesktopPath) & " UserName: " & Get(UserName) & " UserAcount: " & Get(AccountName) & " HostName: " & Get(HostName) When I use the DesktopPath function I get something like : Macintosh HD/Users/DanielPaquin/Desktop What I am interested in getting is the information contained between /Users and /Desktop i.e: DanielPaquin I've tried UserName and AccountName and found out those were in relation to FMP. I then used HostName which gave me the name of the MacMini server, in this case being ARWEN. Is there a get function which would give me only DanielPaquin In the meantime I will continue searching. Best regards! Daniel
bcooney Posted March 6, 2011 Posted March 6, 2011 It would be helpful to know why you need the name of this directory. Otherwise, this is simply a parsing question.
Daniel Paquin Posted March 6, 2011 Author Posted March 6, 2011 The data files used by the FMP DBMS I am currently creating is always located in the UserLogon name directory. At that location, there also a list of folders which are used by other MAC system component. Then if a user logon onto the system under MrX, all required files will then be located under ../Users/MrX/... I am trying to see if there is a quick way to point to that folder without parsing. At this moment, I am using this parsing function which I need to clean up since FMP is giving me an error. Best regards! Daniel Let ( [ StartPos = Position ( Get(DesktopPath) ; "/Users/" ; 1 ; 1 )+7; Len = Position ( Get(DesktopPath) ; "/Desktop" ; 1 ; 1 ) - StartPos; UserHost = Middle (get(DesktopPath); StartPos;Len) ] );
comment Posted March 6, 2011 Posted March 6, 2011 Try = Let ( [ path = Get ( DesktopPath ) ; start = Position ( path ; "/Users/" ; 1 ; 1 ) +7 ; end = Position ( path ; "/" ; start ; 1 ) ] ; Middle ( path ; start ; end - start ) )
Daniel Paquin Posted March 6, 2011 Author Posted March 6, 2011 Thanks Comment, it is working. Best regards! Daniel
bcooney Posted March 6, 2011 Posted March 6, 2011 Hmm. I'm not following your setup. What do you mean by the data files are in the user's directory?
Recommended Posts
This topic is 5069 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now