Quantcast
Channel: DEVONtechnologies Community - Latest posts
Viewing all articles
Browse latest Browse all 17351

Convert tags to custom text field w smart rule

$
0
0

I would say there is no need for a smart rule. Please read this blog post on how to assess your automation needs…

This AppleScript does what you’re asking for…

property tagDelimiter : "amount="
set od to AppleScript's text item delimiters

tell application id "DNtp"
	if (selected records) is {} then return
	repeat with theRecord in (selected records)
		set recordTags to tags of theRecord
		repeat with theTag in recordTags
			if theTag begins with tagDelimiter then
				set AppleScript's text item delimiters to {tagDelimiter, "€"}
				set md to (text items of theTag)
				set AppleScript's text item delimiters to od
				add custom meta data (md as string) for "Price" to theRecord
				exit repeat
			end if
		end repeat
	end repeat
end tell

Note: I am using a custom attribute, Price, with a data type of Decimal Number as Currency. This would also work with a text-based data type.


Viewing all articles
Browse latest Browse all 17351

Trending Articles