How do I filter out one character? continued....
How do I filter out one character? continued....
- Subject: How do I filter out one character? continued....
- From: Jeffrey Madson <email@hidden>
- Date: Tue, 30 Oct 2018 14:40:00 -0500
Takaaki,
Thanks for the quick response! Where would your two lines of code be
inserted and should it replace anything?
I'm confused as to why you have a computer name already in there? Each
computer name will be different based on the information it pulls from the
three data bases. Then whatever that name is, I need to delete the 3rd
character.
On Tue, Oct 30, 2018 at 2:00 PM <email@hidden>
wrote:
> Send AppleScript-Users mailing list submissions to
> email@hidden
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.apple.com/mailman/listinfo/applescript-users
> or, via email, send a message with subject or body 'help' to
> email@hidden
>
> You can reach the person managing the list at
> email@hidden
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of AppleScript-Users digest..."
>
>
> Today's Topics:
>
> 1. How do I filter out one character? (Jeffrey Madson)
> 2. Re: How do I filter out one character? (Takaaki Naganoya)
> 3. Can anyone inspect menu elements by using Accessibility
> Inspector v5 ? (Takaaki Naganoya)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 29 Oct 2018 14:53:29 -0500
> From: Jeffrey Madson <email@hidden>
> To: "email@hidden"
> <email@hidden>
> Subject: How do I filter out one character?
> Message-ID:
> <
> email@hidden>
> Content-Type: text/plain; charset="utf-8"
>
> As a newbie I have managed to write a script after a lot of borrowing and
> testing that will insert the name of my Mac into System
> Preferences/Sharing/Computer Name. The script pulls information from three
> different data sources and in the end produces a name like
> this: CA02673AC638520
>
> The problem is that there is an extra character I need to filter out the
> third character in every case so it should look like this: CA2673AC638520.
> In the location code area of the script below I need to strip out the third
> character. After many attempts I have been unable to do this. Any
> suggestions?
>
>
> #Generate ComputerName
> if [ -z "$ComputerInfo" ]
> then
> computername="SiteCode-AssetTag"
> else
> #Set State, Location Code and Asset Tag variables
> state=$(echo "$ComputerInfo" | cut -d',' -f1)
> state=$(echo "${state//\"/}")
>
> locationcode=$(echo "$ComputerInfo" | cut -d',' -f2)
> locationcode=$(echo "${locationcode//\"/}")
>
> assettag=$(echo "$ComputerInfo" | cut -d',' -f3)
> assettag=$(echo "${assettag//\"/}")
>
>
> #Generate the Computer Name
> computername=$state$locationcode$assettag
> fi
>
> Thanks for your help!
>
> MacGeek
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://lists.apple.com/mailman/private/applescript-users/attachments/20181029/a7f6b685/attachment.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Tue, 30 Oct 2018 08:41:05 +0900
> From: Takaaki Naganoya <email@hidden>
> To: "email@hidden"
> <email@hidden>
> Subject: Re: How do I filter out one character?
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=utf-8
>
> Do you mean to delete 3rd character?
>
>
> set aText to "CA02673AC638520"
> set bText to (text 1 thru 2 of aText) & (text 4 thru -1 of aText)
> —> “CA2673AC638520"
>
>
> --
> Takaaki Naganoya
> email@hidden
> http://piyocast.com/as/
>
> > 2018/10/30 4:53、Jeffrey Madson <email@hidden>のメール:
> >
> > As a newbie I have managed to write a script after a lot of borrowing
> and testing that will insert the name of my Mac into System
> Preferences/Sharing/Computer Name. The script pulls information from three
> different data sources and in the end produces a name like this:
> CA02673AC638520
> >
> > The problem is that there is an extra character I need to filter out the
> third character in every case so it should look like this: CA2673AC638520.
> In the location code area of the script below I need to strip out the third
> character. After many attempts I have been unable to do this. Any
> suggestions?
> >
> >
> > #Generate ComputerName
> > if [ -z "$ComputerInfo" ]
> > then
> > computername="SiteCode-AssetTag"
> > else
> > #Set State, Location Code and Asset Tag variables
> > state=$(echo "$ComputerInfo" | cut -d',' -f1)
> > state=$(echo "${state//\"/}")
> >
> > locationcode=$(echo "$ComputerInfo" | cut -d',' -f2)
> > locationcode=$(echo "${locationcode//\"/}")
> >
> > assettag=$(echo "$ComputerInfo" | cut -d',' -f3)
> > assettag=$(echo "${assettag//\"/}")
> >
> >
> > #Generate the Computer Name
> > computername=$state$locationcode$assettag
> > fi
> >
> > Thanks for your help!
> >
> > MacGeek
> >
> >
> >
> >
> >
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > AppleScript-Users mailing list (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> >
> > Archives: http://lists.apple.com/archives/applescript-users
> >
> > This email sent to email@hidden
>
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 30 Oct 2018 16:33:41 +0900
> From: Takaaki Naganoya <email@hidden>
> To: "email@hidden"
> <email@hidden>
> Subject: Can anyone inspect menu elements by using Accessibility
> Inspector v5 ?
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=utf-8
>
> I found the current version of Accessibility Inspector is 5.0 (Xcode 10.0,
> macOS 10.14.1beta).
> My main machine is macOS 10.12.6 and Xcode 9.2. It includes Accessibility
> Inspector v5.0.
>
> I use UIBrowser for usual GUI Element inspecting tool. But it can not
> inspect popup menu items.
> So, Accessibility Inspector v4.0 was a good tool to inspect popup menu
> items.
>
> Accessibility Inspector v5.0 seems quite different from previous version
> of it.
> And it seems not to be able to inspect all menu items (I suspect).
>
> Now, we can download “Accessibility Tools for Xcode - February 2012”
> archive including Accessibility Inspector v4.0 if you join Apple Developer
> Program. It runs on macOS 10.12.6.
>
> Question: Can anyone inspect menu elements by using Accessibility
> Inspector v5.x ? I can not.
>
>
> --
> Takaaki Naganoya
> email@hidden
> http://piyocast.com/as/
>
>
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> AppleScript-Users mailing list
> email@hidden
> https://lists.apple.com/mailman/listinfo/applescript-users
>
>
> ------------------------------
>
> End of AppleScript-Users Digest, Vol 15, Issue 172
> **************************************************
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden