• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ALERT - List is not available in Name - AppleScript

Enthusiast ,
Jan 20, 2021 Jan 20, 2021

Copy link to clipboard

Copied

Hi All,

 

Request:
I need to alert or stop the tool execution, if any one of my list of langauge code that should not match with the selected folder name.  

 

i.e., 

set myList to {"eng", "fren", "arab", "chin"}

set theFolderName to "abcdef"

 

Here the condition is false. So I want to stop the tool execution.

Please help on this.

 

Thanks

SS

 

 

TOPICS
Scripting

Views

199

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 24, 2021 Jan 24, 2021

Check if the name is not in the list followed by return, which will stop the script:

 

 

set myList to {"eng", "fren", "arab", "chin"}

set theFolderName to "abcdef"

if theFolderName is not in myList then
	display dialog theFolderName & " is not in myList"
	return
end if

display dialog theFolderName & " is in myList"

 

 

Votes

Translate

Translate
People's Champ ,
Jan 20, 2021 Jan 20, 2021

Copy link to clipboard

Copied

Can you provide more details ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 24, 2021 Jan 24, 2021

Copy link to clipboard

Copied

LATEST

Check if the name is not in the list followed by return, which will stop the script:

 

 

set myList to {"eng", "fren", "arab", "chin"}

set theFolderName to "abcdef"

if theFolderName is not in myList then
	display dialog theFolderName & " is not in myList"
	return
end if

display dialog theFolderName & " is in myList"

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines